Random access method, apparatus, device, and storage device

ABSTRACT

This application provides a random access method, apparatus, and device, and a storage medium. The method includes: A terminal device scrambles first identification information of the terminal device by using an OCC, and sends a first message to a network device. After receiving the first message sent by the terminal device, the network device sends a second message to the terminal device based on the first message, where the second message includes identification information of one or more terminal devices that succeed in random access, so that the terminal device can determine, based on the identification information of the one or more terminal devices the one or more terminal devices include the first identification information of this terminal device, whether this terminal device succeeds or fails in random access.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of International Application No.PCT/CN2019/099936, filed on Aug. 9, 2019, which claims priority toChinese Patent Application No. 201810912253.4, filed on Aug. 10, 2018.The disclosures of the aforementioned applications are herebyincorporated by reference in their entireties.

TECHNICAL FIELD

This application relates to the field of communications technologies,and in particular, to a random access method, apparatus, and device, anda storage medium.

BACKGROUND

After obtaining a cell through searching, a terminal device maysynchronize with the cell, to receive downlink data. However, theterminal device needs to synchronize with the cell before sending uplinkdata. The terminal device may synchronize with the cell by using acontention-based random access process. The contention-based randomaccess process is implemented in four steps: The terminal device sends apreamble (namely, Msg1) to a network device. The network device sends arandom access response (RAR) (namely, Msg2) to the terminal device basedon the received preamble. Then, the terminal device performs uplinkscheduling transmission (namely, Msg3) with the network device for thefirst time. Finally, the network device feeds back contention resolution(namely, Msg4) to the terminal device. It can be learned from theforegoing that an existing contention-based random access process isrelatively complex and has a long access time and high signalingoverheads.

SUMMARY

This application provides a random access method, apparatus, and device,and a storage medium, to simplify a random access process, reduce adelay, and reduce signaling overheads.

According to a first aspect, this application provides a communicationmethod, including: sending a first message to a network device, wherethe first message includes first identification information scrambled byusing an orthogonal cover code (OCC), and the first message is used by aterminal device corresponding to the first identification information torequest random access to the network device; and receiving a secondmessage sent by the network device, where the second message includesidentification information of one or more terminal devices that succeedin random access, so that it can be determined, based on whether theidentification information of the one or more terminal devices includesthe first identification information, whether the random accesssucceeds.

Beneficial effects of this application include: This applicationprovides a two-step random access method, to simplify a random accessprocedure, reduce an access delay of random access, and reduce signalingoverheads. In addition, the first identification information of theterminal device is scrambled by using the OCC, to increase a possibilitythat first identification information of different terminal devices isdifferent, thereby reducing a probability of a collision between thedifferent terminal devices in a random access process, and increasing acapacity of a random access channel.

Optionally, the first message may further include a preamble sequence,and correspondingly, the second message further includes a timingadvance TA that is generated by the network device based on the preamblesequence, to improve uplink synchronization accuracy.

Optionally, there is a mapping relationship between the preamblesequence and the OCC, or there is a mapping relationship between afrequency domain resource used to send the preamble sequence and afrequency domain resource used to send the first identificationinformation. In this way, it is convenient for the network device toobtain the first message through detection, that is, when one of thepreamble sequence and the first identification information is obtainedthrough detection, the other can be obtained, to reduce complexity ofblindly detecting, by the network device, the first message, and improveefficiency of receiving, by the network device, the first message.

Optionally, the frequency domain resource used to send the preamblesequence is the same as the frequency domain resource used to send thefirst identification information, or there is a preset offset betweenthe frequency domain resource used to send the preamble sequence and thefrequency domain resource used to send the first identificationinformation.

Optionally, a random access radio network temporary identifier (RA-RNTI)of the terminal device is determined by using the OCC used to scramblethe first identification information, to reduce a probability of acollision between RA-RNTIs.

Optionally, the RA-RNTI is determined by using the OCC used to scramblethe first identification information, a sequence number of a frequencydomain resource used to send the first message, and a sequence number ofa time domain resource used to send the first message and/or a totalquantity of OCCs available for the terminal device, to increase apossibility that RA-RNTIs determined by different terminal devices basedon different OCCs are different, thereby reducing a probability of acollision between the RA-RNTIs.

Optionally, if an allocation manner of a frequency domain resource usedto send the first message is an interlaced resource allocation manner, asequence number of the frequency domain resource used to send the firstmessage is a sequence number, of the frequency domain resource used tosend the first message, in interlaced resource allocation.

Optionally, after the receiving a second message sent by the networkdevice, the method further includes: if the identification informationof the one or more terminal devices includes the first identificationinformation, sending a third message to the network device, where thethird message is used to indicate that the terminal device correspondingto the first identification information succeeds in the random access;or if the identification information of the one or more terminal devicesdoes not include the first identification information, or the terminaldevice sending the first message fails to decode the second message,sending a fourth message to the network device, to enable the networkdevice to resend the second message to the terminal device based on thefourth message, where the fourth message is used to indicate that theterminal device corresponding to the first identification informationfails in the random access. In this way, sending the third message tothe network device can avoid a resource waste caused because the networkdevice sends the second message to the terminal device. Sending thefourth message to the network device can enable the network device toresend the second message in time without waiting for preset duration,to effectively reduce a random access delay.

Optionally, the first message further includes a sequence number of thepreamble sequence. In this way, when there is no mapping relationshipbetween the preamble and the OCC, and the network device has notreceived the preamble in the first message, the network device mayindicate, based on the sequence number of the preamble sequence, theterminal device to repeat the preamble.

Optionally, the first message further includes a sequence number of thepreamble sequence and a sequence number of a frequency domain resourceused to send the preamble sequence. In this way, when there is nomapping relationship between the preamble and the OCC, and the networkdevice has not received the preamble in the first message, the networkdevice may generate an RA-RNTI based on the received firstidentification information and the received sequence number of thefrequency domain resource of the preamble sequence, and indicate, on aphysical downlink control channel (PDCCH) scrambled by using theRA-RNTI, the terminal device corresponding to the sequence number of thepreamble sequence to repeat the preamble, to ensure that the preamble isrepeated.

Optionally, the sequence number of the preamble sequence and the firstidentification information are sent on a same time-frequency resource,or all of the sequence number of the preamble sequence, the firstidentification information, and the sequence number of the frequencydomain resource used to send the preamble sequence are sent on a sametime-frequency resource, to reduce a resource occupied by the firstmessage.

Optionally, the first message further includes information about anoptimal downlink transmit beam of the network device. For a highfrequency system, efficiency of sending the second message can beimproved.

Optionally, the second message further includes configurationinformation of a physical uplink control channel (PUCCH) used to sendthe third message or used to send the fourth message, so that theterminal device sends, based on the configuration information of thePUCCH in the second message, the third message or the fourth message ona resource indicated by the configuration information of the PUCCH, toprevent congestion from occurring when a plurality of terminal devicessend third messages or fourth messages at the same time.

Optionally, the first identification information is a global uniquenetwork identifier S-TMSI of the terminal device, to reduce aprobability of a collision between different terminal devices.

Optionally, if the terminal device is out of synchronization in theuplink and synchronized in the downlink, the first identificationinformation is a cell radio network temporary identifier (C-RNTI) of theterminal device.

Optionally, if a time-frequency resource available for sending the firstmessage is greater than a time-frequency resource occupied by the firstmessage, the sending a first message to a network device includes:performing listen before talk (LBT) in a plurality of symbol locationsin the time-frequency resource available for sending the first message,and sending the first message in the first symbol location in which LBTsucceeds. In this way, a sending success rate of the first message canbe increased.

Optionally, the receiving a second message sent by the network deviceincludes: after receiving a PDCCH that is scrambled by using the RA-RNTIand that is sent by the network device, receiving, based on the PDCCH,the second message sent by the network device, to accurately receive thesecond message.

Optionally, the sending a first message to a network device includes:randomly selecting an OCC from a plurality of OCCs available for theterminal device, and scrambling the first identification information byusing the selected OCC; and sending, to the network device on a randomlyselected time-frequency resource used for random access, the firstmessage carrying the scrambled first identification information. In thisway, the first identification information is scrambled by using therandomly selected OCC, to increase a possibility that firstidentification information of different terminal devices is different,thereby reducing a probability of a collision between the terminaldevices.

Optionally, the second message further includes a timing advance (TA),to improve uplink synchronization accuracy.

According to a second aspect, this application provides a random accessmethod, including: receiving a first message sent by a terminal device,where the first message includes first identification informationscrambled by using an OCC, and the first message is used by the terminaldevice corresponding to the first identification information to requestrandom access to the network device; and sending a second message to theterminal device based on the first message, where the second messageincludes identification information of one or more terminal devices thatsucceed in random access, and the identification information of the oneor more terminal devices includes the first identification information.

Beneficial effects of this application include: This applicationprovides a two-step random access method, to simplify a random accessprocedure, reduce an access delay of random access, and reduce signalingoverheads. In addition, the first identification information of theterminal device is scrambled by using the OCC, to increase a possibilitythat first identification information of different terminal devices isdifferent, thereby reducing a probability of a collision between thedifferent terminal devices in a random access process, and increasing acapacity of a random access channel.

Optionally, the first message further includes a preamble sequence, andthe sending a second message to the terminal device based on the firstmessage includes: generating a timing advance based on the preamblesequence; and sending the second message to the terminal device, wherethe second message includes the timing advance. In this way, uplinksynchronization accuracy can be improved.

Optionally, there is a mapping relationship between the preamblesequence and the OCC, or there is a mapping relationship between afrequency domain resource used to send the preamble sequence and afrequency domain resource used to send the first identificationinformation. In this way, it is convenient for the network device toobtain the first message through detection, and when one of the preamblesequence and the first identification information is obtained throughdetection, the other can be obtained, to reduce complexity of blindlydetecting, by the network device, the first message, and improveefficiency of receiving, by the network device, the first message.

Optionally, the frequency domain resource used to send the preamblesequence is the same as the frequency domain resource used to send thefirst identification information, or there is a preset offset betweenthe frequency domain resource used to send the preamble sequence and thefrequency domain resource used to send the first identificationinformation.

Optionally, if there is the mapping relationship between the preamblesequence and the OCC, the receiving a first message sent by the terminaldevice includes: blindly detecting a time-frequency resource used forrandom access, and detecting the preamble sequence; and receiving, basedon the mapping relationship between the preamble sequence and the OCC,the first identification information scrambled by using the OCC. In thisway, it is convenient for the network device to obtain the first messagethrough detection, that is, when one of the preamble sequence and thefirst identification information is obtained through detection, theother can be obtained, to reduce complexity of blindly detecting, by thenetwork device, the first message, and improve efficiency of receiving,by the network device, the first message.

Optionally, if there is the mapping relationship between the frequencydomain resource used to send the preamble sequence and the frequencydomain resource used to send the first identification information, thereceiving a first message sent by the terminal device includes: blindlydetecting a time-frequency resource used for random access, andobtaining, through detection, the frequency domain resource used to sendthe preamble sequence; and obtaining, based on the mapping relationshipbetween the frequency domain resource used to send the preamble sequenceand the frequency domain resource used to send the first identificationinformation, the frequency domain resource used to send the firstidentification information, and receiving the first identificationinformation on the frequency domain resource used to send the firstidentification information. In this way, when obtaining one frequencydomain resource through detection, the network device may learn alocation of the other frequency domain resource, and perform receivingin the location of the frequency domain resource, to reduce complexityof blindly detecting, by the network device, the first message, andimprove efficiency of receiving, by the network device, the firstmessage.

Optionally, the method further includes: determining a RA-RNTI of theterminal device based on the OCC used to scramble the firstidentification information, scrambling a PDCCH by using the RA-RNTI, andsending the second message to the terminal device on a time-frequencyresource indicated by the scrambled PDCCH, to reduce a probability of acollision between RA-RNTIs.

Optionally, the determining a RA-RNTI of the terminal device based onthe OCC used to scramble the first identification information includes:determining the RA-RNTI based on the OCC used to scramble the firstidentification information, a sequence number of a frequency domainresource used to send the first message, and a sequence number of a timedomain resource used to send the first message and/or a total quantityof OCCs available for the terminal device. In this way, a possibilitythat RA-RNTIs determined by different terminal devices based ondifferent OCCs are different can be further increased, to reduce aprobability of a collision between the RA-RNTIs.

Optionally, if an allocation manner of the frequency domain resourceused to send the first message is an interlaced resource allocationmanner, the sequence number of the frequency domain resource used tosend the first message is a sequence number, of the frequency domainresource used to send the first message, in interlaced resourceallocation.

Optionally, after the sending a second message to the terminal devicebased on the first message, the method further includes: receiving athird message sent by the terminal device, where the third message isused to indicate that the terminal device corresponding to the firstidentification information succeeds in the random access; or receiving afourth message sent by the terminal device, and resending the secondmessage based on the fourth message, where the fourth message is used toindicate that the terminal device corresponding to the firstidentification information fails in the random access. In this way,sending the third message to the network device can avoid a resourcewaste caused because the network device sends the second message to theterminal device. Sending the fourth message to the network device canenable the network device to resend the second message in time withoutwaiting for preset duration, to effectively reduce a random accessdelay.

Optionally, the first message further includes a sequence number of thepreamble sequence. In this way, when there is no mapping relationshipbetween the preamble and the OCC, and the network device has notreceived the preamble in the first message, the network device mayindicate, based on the sequence number of the preamble sequence, theterminal device to repeat the preamble.

Optionally, the first message further includes a sequence number of thepreamble sequence and a sequence number of a frequency domain resourceused to send the preamble sequence. In this way, when there is nomapping relationship between the preamble and the OCC, and the networkdevice has not received the preamble in the first message, the networkdevice may generate an RA-RNTI based on the received firstidentification information and the received sequence number of thefrequency domain resource of the preamble sequence, and indicate, on aPDCCH scrambled by using the RA-RNTI, the terminal device correspondingto the sequence number of the preamble sequence to repeat the preamble,to ensure that the preamble is repeated.

Optionally, the sequence number of the preamble sequence and the firstidentification information are sent on a same time-frequency resource,or all of the sequence number of the preamble sequence, the firstidentification information, and the sequence number of the frequencydomain resource used to send the preamble sequence are sent on a sametime-frequency resource, to reduce a resource occupied by the firstmessage.

Optionally, the first message further includes information about anoptimal downlink transmit beam of the network device. For a highfrequency system, efficiency of sending the second message can beimproved.

Optionally, the second message further includes configurationinformation of a PUCCH used to send the third message or used to sendthe fourth message, so that the terminal device sends, based on theconfiguration information of the PUCCH in the second message, the thirdmessage or the fourth message on a resource indicated by theconfiguration information of the PUCCH, to prevent congestion fromoccurring when a plurality of terminal devices send third messages orfourth messages at the same time.

Optionally, the first identification information is a global uniquenetwork identifier S-TMSI of the terminal device, to reduce aprobability of a collision between different terminal devices.

Optionally, if the terminal device is out of synchronization in theuplink and synchronized in the downlink, the first identificationinformation is a cell radio network temporary identifier C-RNTI of theterminal device.

The following provides several random access apparatuses and devices.Content and effects of the random access apparatuses and devicescorrespond to content and effects of the foregoing methods. The contentand technical effects are not described below again.

According to a third aspect, this application provides a random accessapparatus, including:

-   -   a sending module, configured to send a first message to a        network device, where the first message includes first        identification information scrambled by using an OCC, and the        first message is used by a terminal device corresponding to the        first identification information to request random access to the        network device;    -   a receiving module, configured to receive a second message sent        by the network device, where the second message includes        identification information of one or more terminal devices that        succeed in random access; and    -   a processing module, configured to determine, based on whether        the identification information of the one or more terminal        devices includes the first identification information, whether        the random access succeeds.

Optionally, the first message further includes a preamble sequence, andthe second message further includes a timing advance that is generatedby the network device based on the preamble sequence.

Optionally, there is a mapping relationship between the preamblesequence and the OCC, or there is a mapping relationship between afrequency domain resource used to send the preamble sequence and afrequency domain resource used to send the first identificationinformation.

Optionally, the frequency domain resource used to send the preamblesequence is the same as the frequency domain resource used to send thefirst identification information, or there is a preset offset betweenthe frequency domain resource used to send the preamble sequence and thefrequency domain resource used to send the first identificationinformation.

Optionally, the apparatus further includes: an RA-RNTI determiningmodule, configured to determine a random access radio network temporaryidentifier RA-RNTI of the terminal device based on the OCC used toscramble the first identification information.

Optionally, the RA-RNTI determining module is specifically configured todetermine the RA-RNTI based on the OCC used to scramble the firstidentification information, a sequence number of a frequency domainresource used to send the first message, and a sequence number of a timedomain resource used to send the first message and/or a total quantityof OCCs available for the terminal device.

Optionally, if an allocation manner of a frequency domain resource usedto send the first message is an interlaced resource allocation manner, asequence number of the frequency domain resource used to send the firstmessage is a sequence number, of the frequency domain resource used tosend the first message, in interlaced resource allocation.

Optionally, the sending module is further configured to: if theidentification information of the one or more terminal devices includesthe first identification information, send a third message to thenetwork device, where the third message is used to indicate that theterminal device corresponding to the first identification informationsucceeds in the random access; or if the identification information ofthe one or more terminal devices does not include the firstidentification information, or the second message fails to be decoded,send a fourth message to the network device, to enable the networkdevice to resend the second message to the terminal device based on thefourth message, where the fourth message is used to indicate that theterminal device corresponding to the first identification informationfails in the random access.

Optionally, the first message further includes a sequence number of thepreamble sequence, or the first message further includes a sequencenumber of the preamble sequence and a sequence number of a frequencydomain resource used to send the preamble sequence.

Optionally, the sequence number of the preamble sequence and the firstidentification information are sent on a same time-frequency resource,or

-   -   all of the sequence number of the preamble sequence, the first        identification information, and the sequence number of the        frequency domain resource used to send the preamble sequence are        sent on a same time-frequency resource.

Optionally, the first message further includes information about anoptimal downlink transmit beam of the network device.

Optionally, the second message further includes configurationinformation of a PUCCH used to send the third message or used to sendthe fourth message.

Optionally, the first identification information is a global uniquenetwork identifier S-TMSI of the terminal device.

Optionally, if the terminal device is out of synchronization in theuplink and synchronized in the downlink, the first identificationinformation is a C-RNTI of the terminal device.

Optionally, the sending module is further configured to: if atime-frequency resource available for sending the first message isgreater than a time-frequency resource occupied by the first message,perform LBT in a plurality of symbol locations in the time-frequencyresource available for sending the first message, and send the firstmessage in the first symbol location in which LBT succeeds.

Optionally, the receiving module is specifically configured to: afterreceiving a PDCCH that is scrambled by using the RA-RNTI and that issent by the network device, receive, based on the PDCCH, the secondmessage sent by the network device.

Optionally, the processing module is further configured to: randomlyselect an OCC from a plurality of OCCs available for the terminaldevice, and scramble the first identification information by using theselected OCC; and

-   -   the sending module is configured to send, to the network device        on a randomly selected time-frequency resource used for random        access, the first message carrying the scrambled first        identification information.

According to a fourth aspect, this application provides a random accessapparatus, including:

-   -   a receiving module, configured to receive a first message sent        by a terminal device, where the first message includes first        identification information scrambled by using an OCC, and the        first message is used by the terminal device corresponding to        the first identification information to request random access to        the network device; and    -   a sending module, configured to send a second message to the        terminal device based on the first message, where the second        message includes identification information of one or more        terminal devices that succeed in random access, and the        identification information of the one or more terminal devices        includes the first identification information.

Optionally, the first message further includes a preamble sequence, andthe apparatus further includes:

-   -   a timing advance generation module, configured to generate a        timing advance based on the preamble sequence, where    -   the sending module is further configured to send the second        message to the terminal device, where the second message        includes the timing advance.

Optionally, there is a mapping relationship between the preamblesequence and the OCC, or there is a mapping relationship between afrequency domain resource used to send the preamble sequence and afrequency domain resource used to send the first identificationinformation.

Optionally, the frequency domain resource used to send the preamblesequence is the same as the frequency domain resource used to send thefirst identification information, or there is a preset offset betweenthe frequency domain resource used to send the preamble sequence and thefrequency domain resource used to send the first identificationinformation.

Optionally, if there is the mapping relationship between the preamblesequence and the OCC, the receiving module is specifically configuredto: blindly detect a time-frequency resource used for random access,detect the preamble sequence, and receive, based on the mappingrelationship between the preamble sequence and the OCC, the firstidentification information scrambled by using the OCC.

Optionally, if there is the mapping relationship between the frequencydomain resource used to send the preamble sequence and the frequencydomain resource used to send the first identification information, thereceiving module is specifically configured to: blindly detect atime-frequency resource used for random access, obtain, throughdetection, the frequency domain resource used to send the preamblesequence, obtain, based on the mapping relationship between thefrequency domain resource used to send the preamble sequence and thefrequency domain resource used to send the first identificationinformation, the frequency domain resource used to send the firstidentification information, and receive the first identificationinformation on the frequency domain resource used to send the firstidentification information.

Optionally, the apparatus further includes: an RA-RNTI determiningmodule, configured to determine a RA-RNTI of the terminal device basedon the OCC used to scramble the first identification information; and

-   -   a scrambling module, configured to scramble a PDCCH by using the        RA-RNTI, where    -   the sending module is specifically configured to send the second        message to the terminal device on a time-frequency resource        indicated by the scrambled PDCCH.

Optionally, the RA-RNTI determining module is specifically configured todetermine the RA-RNTI based on the OCC used to scramble the firstidentification information, a sequence number of a frequency domainresource used to send the first message, and a sequence number of a timedomain resource used to send the first message and/or a total quantityof OCCs available for the terminal device.

Optionally, if an allocation manner of the frequency domain resourceused to send the first message is an interlaced resource allocationmanner, the sequence number of the frequency domain resource used tosend the first message is a sequence number, of the frequency domainresource used to send the first message, in interlaced resourceallocation.

Optionally, the receiving module is further configured to receive athird message sent by the terminal device, where the third message isused to indicate that the terminal device corresponding to the firstidentification information succeeds in the random access; or configuredto receive a fourth message sent by the terminal device, where thefourth message is used to indicate that the terminal devicecorresponding to the first identification information fails in therandom access; and

-   -   the sending module is further configured to resend the second        message to the terminal device based on the fourth message.

Optionally, the first message further includes a sequence number of thepreamble sequence, or the first message further includes a sequencenumber of the preamble sequence and a sequence number of a frequencydomain resource used to send the preamble sequence.

Optionally, the sequence number of the preamble sequence and the firstidentification information are sent on a same time-frequency resource,or

-   -   all of the sequence number of the preamble sequence, the first        identification information, and the sequence number of the        frequency domain resource used to send the preamble sequence are        sent on a same time-frequency resource.

Optionally, the first message further includes information about anoptimal downlink transmit beam of the network device.

Optionally, the second message further includes configurationinformation of a PUCCH used to send the third message or used to sendthe fourth message.

Optionally, the first identification information is a global uniquenetwork identifier S-TMSI of the terminal device.

Optionally, if the terminal device is out of synchronization in theuplink and synchronized in the downlink, the first identificationinformation is a C-RNTI of the terminal device.

According to a fifth aspect, this application provides a random accessdevice, including:

-   -   a transmitter, configured to send a first message to a network        device, where the first message includes first identification        information scrambled by using an OCC, and the first message is        used by a terminal device corresponding to the first        identification information to request random access to the        network device;    -   a receiver, configured to receive a second message sent by the        network device, where the second message includes identification        information of one or more terminal devices that succeed in        random access; and    -   a processor, configured to determine, based on whether the        identification information of the one or more terminal devices        includes the first identification information, whether the        random access succeeds.

Optionally, the first message further includes a preamble sequence, andthe second message further includes a timing advance that is generatedby the network device based on the preamble sequence.

Optionally, there is a mapping relationship between the preamblesequence and the OCC, or there is a mapping relationship between afrequency domain resource used to send the preamble sequence and afrequency domain resource used to send the first identificationinformation.

Optionally, the frequency domain resource used to send the preamblesequence is the same as the frequency domain resource used to send thefirst identification information, or there is a preset offset betweenthe frequency domain resource used to send the preamble sequence and thefrequency domain resource used to send the first identificationinformation.

Optionally, the processor is further configured to determine a RA-RNTIof the terminal device based on the OCC used to scramble the firstidentification information.

Optionally, the processor is specifically configured to determine theRA-RNTI based on the OCC used to scramble the first identificationinformation, a sequence number of a frequency domain resource used tosend the first message, and a sequence number of a time domain resourceused to send the first message and/or a total quantity of OCCs availablefor the terminal device.

Optionally, if an allocation manner of a frequency domain resource usedto send the first message is an interlaced resource allocation manner, asequence number of the frequency domain resource used to send the firstmessage is a sequence number, of the frequency domain resource used tosend the first message, in interlaced resource allocation.

Optionally, the transmitter is further configured to: if theidentification information of the one or more terminal devices includesthe first identification information, send a third message to thenetwork device, where the third message is used to indicate that theterminal device corresponding to the first identification informationsucceeds in the random access; or if the identification information ofthe one or more terminal devices does not include the firstidentification information, or the second message fails to be decoded,send a fourth message to the network device, to enable the networkdevice to resend the second message to the terminal device based on thefourth message, where the fourth message is used to indicate that theterminal device corresponding to the first identification informationfails in the random access.

Optionally, the first message further includes a sequence number of thepreamble sequence, or the first message further includes a sequencenumber of the preamble sequence and a sequence number of a frequencydomain resource used to send the preamble sequence.

Optionally, the sequence number of the preamble sequence and the firstidentification information are sent on a same time-frequency resource,or

-   -   all of the sequence number of the preamble sequence, the first        identification information, and the sequence number of the        frequency domain resource used to send the preamble sequence are        sent on a same time-frequency resource.

Optionally, the first message further includes information about anoptimal downlink transmit beam of the network device.

Optionally, the second message further includes configurationinformation of a PUCCH used to send the third message or used to sendthe fourth message.

Optionally, the first identification information is a global uniquenetwork identifier S-TMSI of the terminal device.

Optionally, if the terminal device is out of synchronization in theuplink and synchronized in the downlink, the first identificationinformation is a cell radio network temporary identifier C-RNTI of theterminal device.

Optionally, the transmitter is further configured to: if atime-frequency resource available for sending the first message isgreater than a time-frequency resource occupied by the first message,perform LBT in a plurality of symbol locations in the time-frequencyresource available for sending the first message, and send the firstmessage in the first symbol location in which LBT succeeds.

Optionally, the receiver is specifically configured to: after receivinga PDCCH that is scrambled by using the RA-RNTI and that is sent by thenetwork device, receive, based on the PDCCH, the second message sent bythe network device.

Optionally, the processor is configured to: randomly select an OCC froma plurality of OCCs available for the terminal device, and scramble thefirst identification information by using the selected OCC; and

-   -   the transmitter is configured to send, to the network device on        a randomly selected time-frequency resource used for random        access, the first message carrying the scrambled first        identification information.

According to a sixth aspect, this application provides a random accessdevice, including:

-   -   a receiver, configured to receive a first message sent by a        terminal device, where the first message includes first        identification information scrambled by using an OCC, and the        first message is used by the terminal device corresponding to        the first identification information to request random access to        the network device; and    -   a transmitter, configured to send a second message to the        terminal device based on the first message, where the second        message includes identification information of one or more        terminal devices that succeed in random access, and the        identification information of the one or more terminal devices        includes the first identification information.

Optionally, the first message further includes a preamble sequence, andthe device further includes a processor, where

-   -   the processor is configured to generate a timing advance based        on the preamble sequence; and    -   the transmitter is further configured to send the second message        to the terminal device, where the second message includes the        timing advance.

Optionally, there is a mapping relationship between the preamblesequence and the OCC, or there is a mapping relationship between afrequency domain resource used to send the preamble sequence and afrequency domain resource used to send the first identificationinformation.

Optionally, the frequency domain resource used to send the preamblesequence is the same as the frequency domain resource used to send thefirst identification information, or there is a preset offset betweenthe frequency domain resource used to send the preamble sequence and thefrequency domain resource used to send the first identificationinformation.

Optionally, if there is the mapping relationship between the preamblesequence and the OCC, the receiver is specifically configured to:blindly detect a time-frequency resource used for random access, detectthe preamble sequence, and receive, based on the mapping relationshipbetween the preamble sequence and the OCC, the first identificationinformation scrambled by using the OCC.

Optionally, if there is the mapping relationship between the frequencydomain resource used to send the preamble sequence and the frequencydomain resource used to send the first identification information, thereceiver is specifically configured to: blindly detect a time-frequencyresource used for random access, obtain, through detection, thefrequency domain resource used to send the preamble sequence, obtain,based on the mapping relationship between the frequency domain resourceused to send the preamble sequence and the frequency domain resourceused to send the first identification information, the frequency domainresource used to send the first identification information, and receivethe first identification information on the frequency domain resourceused to send the first identification information.

Optionally, the processor is further configured to determine a RA-RNTIof the terminal device based on the OCC used to scramble the firstidentification information, and scramble a PDCCH by using the RA-RNTI;and

-   -   the transmitter is specifically configured to send the second        message to the terminal device on a time-frequency resource        indicated by the scrambled PDCCH.

Optionally, the processor is specifically configured to determine theRA-RNTI based on the OCC used to scramble the first identificationinformation, a sequence number of a frequency domain resource used tosend the first message, and a sequence number of a time domain resourceused to send the first message and/or a total quantity of OCCs availablefor the terminal device.

Optionally, if an allocation manner of the frequency domain resourceused to send the first message is an interlaced resource allocationmanner, the sequence number of the frequency domain resource used tosend the first message is a sequence number, of the frequency domainresource used to send the first message, in interlaced resourceallocation.

Optionally, the receiver is further configured to receive a thirdmessage sent by the terminal device, where the third message is used toindicate that the terminal device corresponding to the firstidentification information succeeds in the random access; or configuredto receive a fourth message sent by the terminal device, where thefourth message is used to indicate that the terminal devicecorresponding to the first identification information fails in therandom access; and

-   -   the transmitter is further configured to resend the second        message to the terminal device based on the fourth message.

Optionally, the first message further includes a sequence number of thepreamble sequence, or the first message further includes a sequencenumber of the preamble sequence and a sequence number of a frequencydomain resource used to send the preamble sequence.

Optionally, the sequence number of the preamble sequence and the firstidentification information are sent on a same time-frequency resource,or

-   -   all of the sequence number of the preamble sequence, the first        identification information, and the sequence number of the        frequency domain resource used to send the preamble sequence are        sent on a same time-frequency resource.

Optionally, the first message further includes information about anoptimal downlink transmit beam of the network device.

Optionally, the second message further includes configurationinformation of a PUCCH used to send the third message or used to sendthe fourth message.

Optionally, the first identification information is a global uniquenetwork identifier S-TMSI of the terminal device.

Optionally, if the terminal device is out of synchronization in theuplink and synchronized in the downlink, the first identificationinformation is a C-RNTI of the terminal device.

According to a seventh aspect, a random access device is provided,including:

-   -   a memory, configured to store a computer program; and    -   a processor, configured to execute the computer program, to        implement the random access method according to the first aspect        or the second aspect.

According to an eighth aspect, this application provides a computerstorage medium, where the storage medium includes a computerinstruction, and when the instruction is executed by a computer, thecomputer is enabled to implement the random access method according toeither of the first aspect and the second aspect.

According to a ninth aspect, this application provides a computerprogram product, where the program product includes a computer program,the computer program is stored in a readable storage medium, at leastone processor of a communications apparatus may read the computerprogram from the readable storage medium, and the at least one processorexecutes the computer program, to enable the communications apparatus toperform the random access method according to either of the first aspectand the second aspect.

According to the random access method, apparatus, and device, and thestorage medium that are provided in this application, the terminaldevice scrambles the first identification information of the terminaldevice by using the OCC, and sends the first message to the networkdevice, where the first message includes the scrambled firstidentification information. After receiving the first message sent bythe terminal device, the network device sends the second message to theterminal device based on the first message, where the second messageincludes the identification information of the one or more terminaldevices that succeed in random access, so that the terminal device candetermine, based on whether the one or more terminal devices include thefirst identification information of this terminal device, whether thisterminal device succeeds or fails in random access. To be specific, inthe method, the first identification information of the terminal deviceis added to the first message, to implement two-step random access,thereby simplifying a random access procedure, reducing an access delayof random access, and reducing signaling overheads. In addition, thefirst identification information of the terminal device is scrambled byusing the OCC, to increase a possibility that first identificationinformation of different terminal devices is different, thereby reducinga probability of a collision between the different terminal devices in arandom access process, and increasing a capacity of a random accesschannel.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a schematic diagram of a communications system according to anembodiment of this application;

FIG. 2 is a flowchart of a random access method according to Embodiment1 of this application;

FIG. 3 is an interaction flowchart of a random access method accordingto Embodiment 2 of this application;

FIG. 4 is a schematic diagram of allocating a resource used to send afirst message according to Embodiment 2 of this application;

FIG. 5 is an interaction flowchart of a random access method accordingto Embodiment 3 of this application;

FIG. 6 is a flowchart of a random access method according to Embodiment3 of this application;

FIG. 7 is a schematic diagram of allocating a resource used to send afirst message according to Embodiment 3 of this application;

FIG. 8 is a schematic structural diagram of a random access deviceaccording to an embodiment of this application;

FIG. 9 is a schematic structural diagram of a terminal device accordingto an embodiment of this application;

FIG. 10 is a schematic structural diagram of a random access apparatusaccording to an embodiment of this application; and

FIG. 11 is a schematic structural diagram of a random access apparatusaccording to an embodiment of this application.

DESCRIPTION OF EMBODIMENTS

FIG. 1 is a schematic diagram of a communications system according to anembodiment of this application. As shown in FIG. 1 , the communicationssystem includes a network device and terminal devices.

In the following, some terms in this application are described, to helpa person skilled in the art has a better understanding.

A network device is a device in a wireless network, for example, a radioaccess network (RAN) node that connects a terminal to the wirelessnetwork. Currently, examples of some RAN nodes are: a gNB, atransmission reception point (TRP), an evolved Node B (eNB), a radionetwork controller (RNC), a node B (NB), a base station controller(BSC), a base transceiver station (BTS), a home base station (forexample, a home evolved NodeB, or a home Node B, HNB), a baseband unit(baseband unit, BBU), or a wireless fidelity (Wi-Fi) access point (AP).In a network structure, the network device may include a centralizedunit (CU) node, a distributed unit (DU) node, or a RAN device includinga CU node and a DU node. This is not limited herein.

A terminal device may be a wireless terminal device or a wired terminaldevice. The wireless terminal device may be a device having a wirelesstransceiver function, and may be deployed on land, for example, a devicedeployed indoors or outdoors, or a handheld or vehicle-mounted device;or may be deployed on water (for example, a ship); or may be deployed inthe air (for example, on an airplane, a balloon, or a satellite). Theterminal device may be a mobile phone, a tablet computer (Pad), acomputer with a wireless transceiver function, a virtual reality (VR)terminal device, an augmented reality (AR) terminal device, a wirelessterminal device in industrial control, a wireless terminal device inself-driving, a wireless terminal device in remote medical, a wirelessterminal device in a smart grid, a wireless terminal device intransportation safety, a wireless terminal device in a smart city, awireless terminal device in a smart home, or the like. This is notlimited herein. It may be understood that in this embodiment of thisapplication, the terminal device may be alternatively referred to asuser equipment (UE).

Technical solutions described in the embodiments of this application maybe applied to various communications systems, for example, 2G, 3G, 4G,and 5G communications systems and a next-generation communicationssystem, for example, a Global System for Mobile Communications (GSM), aCode Division Multiple Access (CDMA) system, a Time Division MultipleAccess (TDMA) system, a Wideband Code Division Multiple Access (WCDMA)system, a Frequency Division Multiple Access (FDMA) system, anOrthogonal Frequency-Division Multiple Access (OFDMA) system, asingle-carrier FDMA (SC-FDMA) system, a General Packet Radio Service(GPRS) system, a Long Term Evolution (LTE) system, and othercommunications systems.

In the communications system shown in FIG. 1 , in the following fivescenarios, a terminal device needs to randomly access the networkdevice:

-   -   Scenario 1: A radio resource control (RRC) connection is        initially established. When UE switches from an idle mode to a        connected mode, the UE initiates random access.    -   Scenario 2: An RRC connection is reestablished. After a radio        link fails, the UE needs to reestablish an RRC connection. In        this case, the UE initiates random access.    -   Scenario 3: During handover, the UE initiates random access in a        target cell.    -   Scenario 4: Downlink data arrives. When UE is in a connected        mode, and the network device needs to transmit downlink data to        the UE, but finds that the UE is in an uplink        out-of-synchronization state (the network device side maintains        an uplink timer, and if the network device has not received a        sounding reference signal of the UE when the uplink timer        expires, the network device considers that the UE is out of        synchronization in the uplink), the network device controls the        UE to initiate random access.    -   Scenario 5: Uplink data arrives. When the UE is in a connected        mode, and the UE needs to transmit uplink data to the network        device, but finds that the UE is in an uplink        out-of-synchronization state (the UE side maintains an uplink        timer, and if the UE has not received a TA adjustment command of        the network device when the uplink timer expires, the UE        considers that the UE is out of synchronization in the uplink),        the UE initiates random access.

Random access includes contention-based random access andnon-contention-based random access. A random access method provided inthe embodiments is for a contention-based random access process.

An existing contention-based random access process includes four steps:A terminal device sends a preamble (namely, Msg1) to a network device.The network device sends a random access response (RAR) (namely, Msg2)to the terminal device based on the received preamble. Then, theterminal device performs uplink scheduling transmission (namely, Msg3)with the network device for the first time. Finally, the network devicefeeds back contention resolution (namely, Msg4) to the terminal device.In other words, the existing contention-based random access process isrelatively complex, and has a long access time, an access delay, andhigh signaling overheads.

To resolve the foregoing technical problems, the embodiments of thisapplication provide a two-step random access method, to simplify arandom access procedure, reduce an access delay of random access, andreduce signaling overheads. In addition, first identificationinformation of a terminal device is scrambled by using an orthogonalcover code (OCC), to increase a possibility that first identificationinformation of different terminal devices is different, thereby reducinga probability of a collision between the different terminal devices in arandom access process, and increasing a capacity of a random accesschannel.

FIG. 2 is a flowchart of a random access method according to Embodiment1 of this application. As shown in FIG. 2 , a two-step random accessprocess in this embodiment includes the following steps.

-   -   S201. A terminal device sends a first message to a network        device, where the first message includes first identification        information scrambled by using an orthogonal cover code OCC, and        the first message is used by the terminal device corresponding        to the first identification information to request random access        to the network device.

In this embodiment, when initiating a random access request to thenetwork device, in other words, sending the first message to the networkdevice, the terminal device directly adds the first identificationinformation of the terminal device to the first message. However, in anexisting random access process, a terminal device can send msg3 carryingfirst identification information of the terminal device to a networkdevice only after two steps, that is, the terminal device sends apreamble sequence (preamble) to the network device and the networkdevice configures a temporary network identifier for the terminaldevice. It can be learned that in this step, directly adding the firstidentification information of the terminal device to the first messagecan reduce random access steps, thereby reducing signaling overheads.

In some implementations, the first identification information of theterminal device may be a unique identifier of the terminal device or atemporary identifier of the terminal device.

In some other implementations, the first identification information ofthe terminal device may be a global unique network identifier(SAE-Temporary Mobile Subscriber Identity, S-TMSI) of the terminaldevice.

In some other implementations, the first identification information ofthe terminal device may be a network temporary identifier of theterminal device. For example, if the terminal device is out ofsynchronization in the uplink and synchronized in the downlink (namely,the foregoing scenario 4), the first identification information may be acell radio network temporary identifier (C-RNTI) of the terminal device.The C-RNTI is determined when the terminal device is synchronized withthe network device in the downlink.

In this embodiment, first identification information is scrambled byusing an orthogonal cover code OCC, so that the scrambled firstidentification information is orthogonal to each other, to improveanti-interference performance in a process of transmitting the firstidentification information.

In addition, in this embodiment, different terminal devices may selectdifferent OCCs to scramble respective first identification information,to increase a possibility that the scrambled first identificationinformation is different, thereby reducing a probability of a collisionbetween the different terminal devices in a random access process.

For example, first identification information 1 of a terminal device 1is the same as first identification information 2 of a terminal device2, but OCCs selected by the terminal device 1 and the terminal device 2are different. In this way, the first identification information 1 andthe first identification information 2 that are scrambled by using thedifferent OCCs are different. In this case, when the terminal device 1and the terminal device 2 send first messages to the network device atthe same time, the network device can accurately learn, throughdistinguishment based on the scrambled first identification information1 and the scrambled first identification information 2 that are carriedin the first messages, that two different terminal devices initiaterandom access requests, and further may separately allocate uplinkaccess resources to the terminal device 1 and the terminal device 2, toincrease a random access success rate of terminal devices having samefirst identification information, and increase a capacity of a randomaccess channel.

In this embodiment, one terminal device may have a plurality ofavailable OCCs. If an OCC used to scramble first identificationinformation is configured by the network device, for example, configuredby the network device in remaining minimum system information (RMSI) orother system information (OSI), the terminal device scrambles the firstidentification information by using the OCC specified by the networkdevice.

In some embodiments, if the OCC used to scramble the firstidentification information is not configured by the network device, S201may include S201 a and S201 b.

-   -   S201 a: The terminal device randomly selects the OCC from a        plurality of OCCs available for the terminal device, and        scrambles the first identification information by using the        selected OCC.

In this embodiment, a quantity and lengths of the OCCs corresponding tothe terminal device may be provided in a standard, or may be configuredby the network device in the RMSI or the OSI.

Optionally, a quantity of OCCs used to scramble the first identificationinformation may be determined by a quantity of symbols needed forsending the first identification information. For example, if twosymbols are needed for sending the first identification information, thequantity of OCCs used to scramble the first identification informationis also 2. In an example, the two OCCs may be [+1, +1] and [+1, −1], ormay be [+1, +1] and [−1, +1], or may be [−1, −1] and [−1, +1], or may be[−1, −1] and [+1, −1]. Optionally, the two OCCs may be alternativelyorthogonal codes of other lengths.

The terminal device may randomly select the OCC from the plurality ofavailable OCCs to scramble the first identification information of theterminal device. For example, the terminal device 1 selects the OCC [+1,−1] to scramble the first identification information of the terminaldevice 1, and the terminal device 2 selects the OCC [+1, +1] to scramblethe first identification information of the terminal device 2. In thisway, the scrambled two pieces of first identification information areorthogonal. When a plurality of terminal devices send first messages tothe network device, first identification information carried in thefirst messages is orthogonal, to improve anti-interference performancebetween the first messages. In addition, a probability that a collisionoccurs when the plurality of terminal devices send the first messagescan be reduced, and a capacity of a random access channel can beincreased.

-   -   S201 b. The terminal device sends, to the network device on a        randomly selected time-frequency resource used for random        access, the first message carrying the scrambled first        identification information.

After the terminal device scrambles the first identification informationaccording to the method in S201 a, the terminal device randomly selectsa slot (namely, a time domain resource) and a frequency domain resourcethat can be used for random access, and sends the first message carryingthe scrambled first identification information to the network device inthe slot and on the frequency domain resource, to implement sending ofthe first message.

-   -   S202. The network device sends a second message to the terminal        device based on the first message, where the second message        includes identification information of one or more terminal        devices that succeed in random access, and the identification        information of the one or more terminal devices includes the        first identification information.

In this embodiment, when a plurality of terminal devices send randomaccess requests to the network device, the network device has received,at the same time, first messages sent by the plurality of terminaldevices. When the network device has received the first messages sent bythe one or more terminal devices, it indicates that the one or moreterminal devices succeed in random access. The network device parses thefirst messages sent by the one or more terminal devices, and descramblesfirst identification information that is scrambled by using OCCs andthat is in the one or more first messages. Then, the network deviceallocates an uplink access resource to a terminal device correspondingto each piece of descrambled first identification information. Eachallocated uplink resource and each piece of descrambled firstidentification information are added to the second message, and thesecond message is sent to the terminal device.

It can be learned from the foregoing that the second message in thisembodiment includes the identification information of the one or moreterminal devices that succeed in random access.

-   -   S203. The terminal device sending the first message receives the        second message sent by the network device, and determines, based        on whether the identification information of the one or more        terminal devices includes the first identification information,        whether the random access succeeds.

In this embodiment, after sending the first message, the terminal devicelistens to, in a time window, the second message sent by the networkdevice.

If the terminal device has received the second message sent by thenetwork device, the terminal device parses the second message, anddetermines whether the identification information of the one or moreterminal devices that is carried in the second message includes thefirst identification information of the terminal device. If theidentification information includes the first identification informationof the terminal device, the current random access succeeds. If thesecond message does not include the first identification information ofthis terminal device, it is determined that the current random accessfails.

Optionally, when the terminal device sending the first message has notreceived, within a preset time, the second message sent by the networkdevice, the terminal device determines that current the random accessfails, and the terminal device may adjust an uplink transmit power, andresend the first message to the network device by using an adjusteduplink transmit power.

In this embodiment, the identification information of the terminaldevice that succeeds in the random access is directly added to thesecond message. In this way, the terminal device can determine, based onwhether the second message includes the first identification informationof the terminal device, whether the random access succeeds. The randomaccess process is simple and can be completed in only two steps. In amachine type communication (MTC) or ultra-reliable low-latencycommunications (URLLC) scenario, a delay can be effectively reduced andsignaling overheads can be reduced.

In the random access process provided in this embodiment, the terminaldevice scrambles the first identification information of the terminaldevice by using the OCC, and sends the first message to the networkdevice, where the first message includes the scrambled firstidentification information. After receiving the first message sent bythe terminal device, the network device sends the second message to theterminal device based on the first message, where the second messageincludes the identification information of the one or more terminaldevices that succeed in random access, so that the terminal devicesending the first message can determine, based on whether the one ormore terminal devices include the first identification information ofthis terminal device, whether this terminal device succeeds or fails inthe random access. To be specific, in this embodiment, the firstidentification information of the terminal device is added to the firstmessage, to implement two-step random access, thereby simplifying arandom access procedure, reducing an access delay of random access, andreducing signaling overheads. In addition, the first identificationinformation of the terminal device is scrambled by using the OCC, toincrease a possibility that first identification information ofdifferent terminal devices is different, thereby reducing a probabilityof a collision between the different terminal devices in a random accessprocess, and increasing a capacity of a random access channel.

In some possible implementations, after S203, the method in thisembodiment further includes the following steps.

-   -   S204 a. If the identification information of the one or more        terminal devices includes the first identification information,        the terminal device sends a third message to the network device,        where the third message is used to indicate that the terminal        device corresponding to the first identification information        succeeds in the random access.    -   S204 b. The network device receives the third message sent by        the terminal device sending the first message.

Alternatively, in other implementations, after S203, the method in thisembodiment further includes the following steps.

-   -   S204 c. If the identification information of the one or more        terminal devices does not include the first identification        information of the terminal device sending the first message, or        the terminal device sending the first message fails to decode        the second message, the terminal device sending the first        message sends a fourth message to the network device, to enable        the network device to resend the second message based on the        fourth message, where the fourth message is used to indicate        that the terminal device corresponding to the first        identification information (namely, the terminal device sending        the first message) fails in the random access.    -   S204 d. The network device receives the fourth message sent by        the terminal device sending the first message, and resends the        second message based on the fourth message.

In an existing random access process, after a network device sends amessage to a terminal device, if the network device has not received aresponse message of the terminal device within preset duration, thenetwork device may resend the message to the terminal device.

Based on the foregoing reason, during actual use of an existing randomaccess method, if the terminal device succeeds in the random access, andthe network device sends the second message to the terminal device afterpreset duration, a waste of a random access resource is caused. If theterminal device fails in the random access, the terminal device needs towait for preset duration before receiving the second message resent bythe network device, leading to a random access delay. To resolve theforegoing problem, in this embodiment, after receiving the secondmessage sent by the network device, the terminal device sends a responsemessage to the network device in time, to reduce a random access delayand prevent a waste of a random access resource.

Specifically, after receiving the second message sent by the networkdevice, the terminal device sending the first message parses the secondmessage, and determines whether the identification information that isof the one or more terminal devices succeeding in random access and thatis included in the second message includes the first identificationinformation of this terminal device.

If the identification information of the one or more terminal devicesthat is included in the second message includes the first identificationinformation of this terminal device, the terminal device sends the thirdmessage (for example, a hybrid automatic repeat request acknowledgement(HARQ ACK)) to the network device, where the third message is used toindicate that the terminal device corresponding to the firstidentification information succeeds in the random access. Afterreceiving the third message, the network device stops sending the secondmessage to the terminal device sending the first message, to prevent awaste of a random access resource.

Due to an impact of an external factor, for example, electromagneticinterference, or unstable working of a transmitter or a receiver, thesecond message fails to be sent and the terminal device has not receivedthe second message, or the second message changes in a sending,transmission, and receiving process. In this case, the terminal devicemay send the fourth message (for example, a hybrid automatic repeatrequest negative acknowledgement (HARQ NACK)) to the network device, sothat the network device resends the second message to the terminaldevice. Specifically, if the identification information of the one ormore terminal devices that is included in the second message does notinclude the first identification information of this terminal device, orthe terminal device has not received the second message, the terminaldevice sends the fourth message to the network device, where the fourthmessage is used to indicate that the terminal device corresponding tothe first identification information fails in the random access. Afterreceiving the fourth message, the network device resends the secondmessage to the terminal device. In this way, a problem that the randomaccess fails because the second message fails to be sent can beresolved. In addition, the terminal device actively sends the fourthmessage to the network device to enable the network device to resend thesecond message in time without waiting for preset duration, toeffectively reduce a random access delay.

Optionally, in this embodiment, if the identification information of theone or more terminal devices that is included in the second messagestill does not include the first identification information of thisterminal device after the network device sends the second message to theterminal device for a preset quantity of times (for example, threetimes), it is determined that this terminal device fails in the randomaccess.

In this embodiment, after receiving the fourth message sent by theterminal device, the network device resends the second message to theterminal device as described above. Optionally, if the network devicehas received the fourth message sent by the terminal device and a thirdmessage sent by another terminal device, it indicates that the terminaldevice sending the third message succeeds in access, that is, a processof sending the second message is normal, but a conflict occurs. Toprevent a waste of a random access resource, the network device does notresend the second message to the terminal device. Optionally, the secondmessage in this embodiment further includes configuration information ofa PUCCH used to send the third message or used to send the fourthmessage.

In actual application, when a plurality of terminal devices send thirdmessages or fourth messages to the network device at the same time, aPUCCH configured by a system for sending a third message or a fourthmessage may not be able to carry the third messages or the fourthmessages of all the terminal devices. In this case, the network devicein this embodiment adds, to the second message, configurationinformation of the PUCCH used to send the third message or the fourthmessage, so that the terminal devices send, based on the configurationinformation of the PUCCH in the second message, the third messages orthe fourth messages on a resource indicated by the configurationinformation of the PUCCH, to prevent congestion during sending of thethird messages or the fourth messages, and ensure that the networkdevice can receive the third messages or the fourth messages of all therandom access terminal devices.

The configuration information of the PUCCH may include at least one of atime domain location, a frequency domain location, and a used cyclicshift (cyclic shift) value.

FIG. 3 is an interaction flowchart of a random access method accordingto Embodiment 2 of this application. Based on the foregoing embodiment,as shown in FIG. 3 , the random access method in this embodiment mayinclude the following steps.

-   -   S301. A terminal device sends a first message to a network        device, where the first message includes first identification        information scrambled by using an OCC.    -   S302. The network device scrambles a PDCCH by using an RA-RNTI        of the terminal device, and sends a second message to the        terminal device on a time-frequency resource indicated by the        scrambled PDCCH, where the RA-RNTI of the terminal device is        determined by using the OCC used to scramble the first        identification information.    -   S303. After receiving, based on the RA-RNTI of the terminal        device sending the first message, the PDCCH that is scrambled by        using the RA-RNTI and that is sent by the network device, the        terminal device receives, based on the PDCCH, the second message        sent by the network device.

In some implementations, the terminal device sends the first message tothe network device, and before receiving the second message, determinesthe RA-RNTI of the terminal device by using the OCC used to scramble thefirst identification information.

In addition, the network device blindly detects the first message byusing all possible OCCs and on each frequency domain resource (forexample, each interlace) in each slot used for random access. Whenobtaining the first message through detection, the network device mayobtain the OCC used to scramble the first message. The network devicedetermines, by using the OCC used to scramble the first message, theRA-RNTI of the terminal device sending the first message. Then, afterscrambling the PDCCH by using the RA-RNTI, the network device sends thesecond message to the terminal device sending the first message, on thetime-frequency resource that is indicated by the scrambled PDCCH andthat is used to send the second message. The PDCCH carries the RA-RNTI.

The terminal device sending the first message continuously listens to,in a time window based on the RA-RNTI of the terminal device, the PDCCHthat is scrambled by using the RA-RNTI and that is sent by the networkdevice. After obtaining, through detection in the time window, the PDCCHscrambled by using the RA-RNTI of the terminal device, the terminaldevice decodes the second message carried on the time-frequency resourceindicated by the PDCCH, to accurately receive the second message.

A process in which the terminal device determines the RA-RNTI is thesame as a process in which the network device determines the RA-RNTI.The following provides description by using an example in which theterminal device determines the RA-RNTI.

In an existing random access method, an RA-RNTI of a terminal device byusing formula (1):RA−RNTI=1+t_id+10*f_id  (1), where

-   -   t_id (0≤t_id<10) is a subframe number of a random access slot,        and f_id (0≤f_id<6) is a frequency domain number of the random        access slot.

It can be learned from the foregoing formula (1) that when values oft_id randomly selected by different terminal devices are the same andvalues of f_id randomly selected by the different terminal devices arethe same, RA-RNTIs of the different terminal devices are the same,leading to a collision between the RA-RNTIs. When subsequently receivingthe second message, the terminal device cannot accurately receive thesecond message corresponding to the RA-RNTI of the terminal device,leading to a random access failure.

To reduce a probability of a collision between RA-RNTIs, the RA-RNTI ofthe terminal device in this embodiment is determined by using the OCCused to scramble the first identification information, so that theRA-RNTI changes with different OCCs.

Optionally, in this embodiment, the RA-RNTI of the terminal device isdetermined by using a quantity of OCCs and/or a number of the OCC usedto scramble the first identification information.

For example, there are two OCCs, namely, [+1, +1] and [+1, −1],available for the terminal device. A number of the OCC [+1, +1] isIdx_(OCC)=0, and a number of the OCC [+1, +1] is Idx_(OCC)=1. It isassumed that the terminal device selects the OCC [+1, −1] to scramblethe first identification information of this terminal device. In thiscase, the RA-RNTI of the terminal device may be determined by using atotal quantity (for example, 2) of the OCCs available for this terminaldevice. Alternatively, the RA-RNTI of this terminal device is determinedby using a number (for example, 1) of the OCC used to scramble the firstidentification information. Alternatively, the RA-RNTI of this terminaldevice is determined by using a total quantity of OCCs available for theterminal device and a number of the OCC used to scramble the firstidentification information.

In this embodiment, total quantities of OCCs available for differentterminal devices may be different, and numbers of OCCs that are selectedby the terminal devices from a plurality of OCCs to scramble firstidentification information may also be different, to increase apossibility that RA-RNTIs determined by different terminal devices basedon different OCCs are different, thereby reducing a probability of acollision between RA-RNTIs.

In some implementations, the RA-RNTI of the terminal device may bedetermined by using the OCC used to scramble the first identificationinformation and a frequency domain resource used to send the firstmessage.

For example, the RA-RNTI of the terminal device is determined by usingthe number of the OCC used to scramble the first identificationinformation and the frequency domain resource used to send the firstmessage. As shown in formula (2), formula (2) is merely an example, andan implementation of this embodiment is not limited to formula (2):RA−RNTI=1+10*(f_id+Idx_(OCC))  (2), where

f_id is a sequence number of the frequency domain resource used to sendthe first message (namely, a subframe number of a random access slot),and Idx_(OCC) is the number of the OCC selected by the terminal deviceto scramble the first identification information.

Alternatively, the RA-RNTI of the terminal device is determined by usingthe total quantity of OCCs available for the terminal device and afrequency domain resource used to send the first message. As shown informula (3), formula (3) is merely an example, and an implementation ofthis embodiment is not limited to formula (3):RA−RNTI=1+10*(N _(OCC) *f_id)  (3), where

N_(OCC) is the total quantity of OCCs available for the terminal device.

In this way, the RA-RNTI is determined by using the OCC and thefrequency domain resource that is used to send the first message, tofurther reduce a probability of a collision between RA-RNTIs. Forexample, OCCs selected by a terminal device 1 and a terminal device 2 toscramble respective first identification information are the same, butfrequency domain resources selected by the terminal device 1 and theterminal device 2 to send first messages are different. Therefore,RA-RNTIs of the terminal device 1 and the terminal device 2 that areobtained according to formula (2) are different, to prevent a collisionbetween the RA-RNTIs of the two devices. Alternatively, OCCs availablefor a terminal device 1 and a terminal device 2 are the same, butfrequency domain resources selected by the terminal device 1 and theterminal device 2 to send first messages are different. Therefore,RA-RNTIs of the terminal device 1 and the terminal device 2 that areobtained according to formula (3) are different, to prevent a collisionbetween the RA-RNTIs of the two devices.

In some possible implementations, the RA-RNTI of the terminal device maybe determined by using the OCC used to scramble the first identificationinformation, a sequence number of a frequency domain resource used tosend the first message, and a sequence number of a time domain resourceused to send the first message and/or the total quantity of OCCsavailable for the terminal device. The total quantity of OCCs availablefor the terminal device is the same as a quantity of symbols included inthe time domain resource used to send the first message.

The total quantity of OCCs available for the terminal is greater than orequal to the quantity of symbols included in the time domain resourceused to send the first message. In an example, the RA-RNTI of theterminal device is determined by using the number of the OCC used toscramble the first identification information, the sequence number ofthe frequency domain resource used to send the first message, and thesequence number of the time domain resource used to send the firstmessage. For example, as shown in formula (4), formula (4) is merely anexample, and an implementation of this embodiment is not limited toformula (4):RA−RNTI=1+t_id+10*(f_id+Idx_(OCC))  (4), where

t_id is the sequence number of the time domain resource used to send thefirst message.

In another example, the RA-RNTI of the terminal device is determined byusing the number of the OCC used to scramble the first identificationinformation, the sequence number of the frequency domain resource usedto send the first message, and the total quantity of OCCs available forthe terminal device. For example, as shown in formula (5), formula (5)is merely an example, and an implementation of this embodiment is notlimited to formula (5):RA−RNTI=1+10*(N _(OCC) *f_id+Idx_(OCC))  (5), where

In still another example, the RA-RNTI is determined by using the numberof the OCC used to scramble the first identification information, thesequence number of the frequency domain resource used to send the firstmessage, the sequence number of the time domain resource used to sendthe first message, and the total quantity of OCCs available for theterminal device. For example, as shown in formula (6), formula (6) ismerely an example, and an implementation of this embodiment is notlimited to formula (6):RA−RNTI=1+t_id+10*(N _(OCC) *f_id+Idx_(OCC))  (6), where

In this embodiment, a probability that time-frequency resources selectedby different terminal devices to send first messages are the same andOCCs selected by the different terminal devices are the same is greatlyreduced, and determining the RA-RNTI based on the number of the OCC, thesequence number of the frequency domain resource used to send the firstmessage, and the sequence number of the time domain resource used tosend the first message and/or the total quantity of OCCs available forthe terminal device can effectively reduce a probability of a collisionbetween RA-RNTIs.

Optionally, in this embodiment, if an allocation manner of the frequencydomain resource used to send the first message is an interlaced resourceallocation manner, the sequence number of the frequency domain resourceused to send the first message is a sequence number, of the frequencydomain resource used to send the first message, in interlaced resourceallocation.

For example, if a frequency band used to transmit the first message inthis embodiment is an unlicensed frequency band, data transmission onthe unlicensed frequency band imposes requirements on a ratio of atransmission bandwidth to a channel bandwidth and on a transmit powerlimit (a maximum power allowed per MHz). To obtain a higher transmissionpower and meet a transmission bandwidth requirement, the terminal deviceperforms uplink transmission in an interlaced (interlace) resourceallocation manner. As shown in FIG. 4 , a 20 MHz channel bandwidthincludes 106 resource blocks (Resource Block, RB). 100 RBs in the 106RBs are divided into 10 parts, and each part is used as one interlace.An interlace includes a specific quantity of RBs distributed atintervals in an entire transmission bandwidth. RBs allocated to aterminal device are not consecutive, but have a same interval ordifferent intervals. In other words, in an interlace allocated to aterminal device, RBs may be distributed at equal intervals ordistributed at non-equal intervals.

If RBs in an interlace are distributed at equal intervals, eachinterlace includes 10 RBs. The terminal device may use one or moreinterlaces to perform uplink transmission (and to send the firstmessage). For example, if the terminal device selects an interlace 0 tosend the first message, the terminal device performs transmission on RBs0, 10, 20, . . . , and 90. For example, if the terminal device selectsan interlace 5 to send the first message, the terminal device performstransmission on RBs 5, 15, 25, . . . , and 95.

If RBs in an interlace are distributed at non-equal intervals and achannel occupation proportion requirement is met, the interlace may alsobe used to send the first message. For example, the terminal device mayperform transmission on an interlace 0, and the interlace 0 includes RBs0, 15, 20, 35, 40, 65, 70, 75, 85, and 90. An RB mapping manner of aninterlace may be provided in a standard, or may be flexibly configuredby the network device and indicated in RMSI/OSI or other systeminformation.

It can be learned from the foregoing that if the allocation manner ofthe frequency domain resource used to send the first message is theinterlaced allocation manner, the sequence number of the frequencydomain resource used to send the first message in the foregoing formulasis a sequence number of a selected interlace used to send the firstmessage. For example, the sequence number of the frequency domainresource selected by the terminal device to send the first message is 5,and a frequency domain resource corresponding to an interlace 5 is RBs5, 15, . . . , and 95. In this way, the terminal device may send thefirst message on the frequency domain resource: RBs 5, 15, 25, . . . ,and 95.

In this embodiment, if the frequency band used to transmit the firstmessage is an unlicensed frequency band, to ensure that is terminaldevice coexists with another device working on the unlicensed frequencyband, a LBT channel contention access mechanism is used. However, therandom access method in this embodiment includes two steps, and LBTneeds to be performed only twice, to reduce a quantity of times of LBT,thereby further reducing a random access delay.

For example, the first message lasts for 13 symbols, and is mapped tothe last 13 symbols in one 14-symbol slot, and the first symbol is usedto perform LBT.

Optionally, in this embodiment, if a time-frequency resource availablefor sending the first message is greater than a time-frequency resourceoccupied by the first message, S301 may include:

-   -   performing LBT in a plurality of symbol locations in the        time-frequency resource available for sending the first message,        and sending the first message in the first symbol location in        which LBT succeeds.

For example, if the first message lasts for 13 symbols, and a length ofa time window used to send the first message is 27 symbols, the terminaldevice may attempt to send the first message in a plurality of symbollocations, to increase a sending success probability of the firstmessage. For example, the terminal device performs LBT in symbol 1, andif LBT succeeds, the terminal device sends the first message in symbols2 to 14, or if LBT fails, the terminal device performs LBT in symbol 2,and sends the first message in symbols 3 to 15 if LBT succeeds. Byanalogy, the terminal device may send the first message on a time domainresource including 13 consecutive symbols that are in symbols 1-14,symbols 2-15, . . . , and symbols 14-27 and that follow a symbol inwhich LBT succeeds for the first time, to increase a sending successprobability of the first message, and improve timely sending of thefirst message.

In some implementations, this embodiment may further include S304.

-   -   S304. The terminal device sending the first message sends a        third message or a fourth message to the network device.

After receiving the second message according to the foregoing steps, theterminal device sending the first message parses the second message, andif the identification information of the terminal device carried in thesecond message is consistent with the first identifier of this terminaldevice, sends, to the network device, the third message indicating thatrandom access succeeds.

If the identification information of the terminal device carried in thesecond message is inconsistent with the first identification informationof this terminal device, or the terminal device sending the firstmessage has not received, within the time window, the second messagesent by the network device, the terminal device sends the fourth messageto the network device, to enable the network device to resend the secondmessage to the terminal device. For a specific process, refer to thedescriptions of the foregoing embodiments, and details are not describedherein again.

In the random access method provided in this embodiment, the RA-RNTI ofthe terminal device is determined based on the OCC used to scramble thefirst identification information. Because OCCs selected by differentterminal devices may be different, determining the RA-RNTIs based on theOCCs can increase a possibility that RA-RNTIs of the different terminaldevices are different, thereby reducing a probability of a collisionbetween the RA-RNTIs.

FIG. 4 is an interaction flowchart of a random access method accordingto Embodiment 3 of this application. A first signal in this embodimentincludes first identification information but does not include apreamble sequence (Preamble), and a random access process in thisembodiment may include the following steps.

-   -   S501. A terminal device sends a first message to a network        device, where the first message includes first identification        information scrambled by using an OCC, and does not include a        preamble.    -   S502. The network device scrambles a PDCCH by using an RA-RNTI        of the terminal device, and sends the second message to the        terminal device on a time-frequency resource indicated by the        scrambled PDCCH, where the RA-RNTI is determined by using the        OCC used to scramble the first identification information.    -   S503. After receiving the PDCCH that is scrambled by using the        RA-RNTI and that is sent by the network device, the terminal        device sending the first message receives, based on the PDCCH,        the second message sent by the network device.    -   S504. The terminal device sending the first message sends a        third message or a fourth message to the network device.

In a small cellular scenario, duration of an entire preamble is twosymbols. When a PRACH uses a 15 KHz subcarrier spacing (SCS), theduration of the entire preamble is 0.14 ms.

A length of a cyclic prefix (CP) corresponding to the 15 KHz subcarrierspacing is 144 Ts, namely, 4.68 μs. A transmission delay of about 6.7 μsis generated for a cellular cell with a radius of 1 km. Therefore, the4.68 μs CP may correspond to a cell radius of about 700 meters.

It can be learned from the foregoing that when a cell radius is lessthan or equal to 700 meters, a CP with a 15 KHz subcarrier spacing caneliminate an impact caused by a transmission delay on signal receiving.Based on the foregoing reason, assuming that an impact caused by anuplink transmission time error on the receive side is not considered forthe cell, the terminal device does not need to send a preamble for thenetwork device to estimate an uplink time error of the terminal device.In this case, the terminal device adds the first identificationinformation of the terminal device to the first message, and does notneed to add the preamble. In this way, a resource used to send the firstmessage can be reduced, and a delay caused when the terminal deviceselects the preamble can be avoided.

It should be noted that in this embodiment, the first message includesonly the first identification information of the terminal device sendingthe first message. Therefore, a sequence number that is of a frequencydomain resource used to send the first message and that is used tocalculate the RA-RNTI is a sequence number of a frequency domainresource used to send the first identification information, and asequence number that is of a time domain resource used to send the firstmessage and that is used to calculate the RA-RNTI is a sequence numberof a time domain resource used to send the first identificationinformation.

Optionally, in this embodiment, as shown in FIG. 5 , a demodulationreference signal (DMRS) may be carried on the first one or more symbolsin a symbol used to send the first message, and the DMRS is used foruplink channel estimation.

Optionally, the DMRS may be alternatively carried on a middle symbol inan uplink channel.

In the random access method provided in this embodiment, the firstmessage includes only the first identification information of theterminal device, but does not include the preamble. In this way, aresource used to send the first message can be reduced, and a delaycaused when the terminal device selects the preamble can be avoided.

FIG. 6 is a flowchart of a random access method according to Embodiment3 of this application. A first signal in this embodiment includes firstidentification information and a preamble sequence, and a random accessprocess in this embodiment may include the following steps.

-   -   S601. A terminal device sends a first message to a network        device, where the first message includes a preamble sequence and        first identification information that is scrambled by using an        OCC.

In some application scenarios, signal propagation needs time, andsignals sent by terminal devices at different locations arrive at thenetwork device at different times. As a result, signals of the differentterminal devices are asynchronous, and interference is caused becauseorthogonal frequency division multiplexing (OFDM) symbols are notorthogonal.

To ensure that uplink signals arrive at a network device synchronously,terminal devices at different distances need to use different timingadvances to send information.

Therefore, in this embodiment, the first message includes the preamble,where the preamble is used for the network device to evaluate a timingadvance of the terminal device, to improve uplink synchronizationaccuracy. In addition, precise uplink synchronization helps to performdata transmission between the network device and the terminal device byusing a higher modulation and coding scheme (MCS).

In some implementations, there is a mapping relationship between thepreamble and the OCC. In this way, the terminal device may randomlyselect one of the preamble and the OCC, and determine the other based onthe mapping relationship between the preamble and the OCC. For example,the terminal device randomly selects the preamble, and then maydetermine, based on the mapping relationship between the preamble andthe OCC, the OCC corresponding to the preamble. Alternatively, theterminal device randomly selects the OCC, and then may determine, basedon the mapping relationship between the preamble and the OCC, thepreamble corresponding to the OCC, to improve efficiency of selecting,by the terminal device, the preamble and the OCC. In an example, it isassumed that the terminal device transmits the preamble by using twosymbols. When the terminal device uses preamble 0, an OCC used by theterminal device to scramble the first identification information is, forexample, [+1 +1], and when the terminal device uses preamble 1, an OCCused by the terminal device to scramble the first identificationinformation is, for example, [+1 −1]. When the terminal device sendsmore than two preambles, all preambles may be divided into two groups,and each group corresponds to two OCCs. Configuration information of thepreamble and the OCC may be configured by using signaling such as aphysical broadcast channel (PBCH), remaining minimum system information(RMSI), other system information (OSI), or radio resource control (RRC),or may be directly provided in a standard. In this embodiment, there iscorrelation between the preamble and the OCC in the first message, andit is convenient for the network device to obtain the first messagethrough detection. For example, the network device obtains the preamblethrough detection, and may obtain, through detection based on themapping relationship between the preamble and the OCC, the firstidentifier scrambled by using the OCC, to improve efficiency ofreceiving, by the network device, the first message.

In some other implementations, there is a mapping relationship between afrequency domain resource used to send the preamble and a frequencydomain resource used to send the first identification information. Inthis way, after randomly selecting the frequency domain resource used tosend the preamble, the terminal device can quickly determine, based onthe mapping relationship between the frequency domain resource used tosend the preamble and the frequency domain resource used to send thefirst identification information, the frequency domain resource used tosend the first identification information, to improve efficiency ofdetermining, by the terminal device, the frequency domain resource usedto send the preamble and the frequency domain resource used to send thefirst identification information. In addition, it is also convenient forthe network device to detect the first message. For example, thepreamble is a sequence. The network device may first obtain the preamblethrough detection, and then quickly learn, based on the mappingrelationship between the frequency domain resource used to send thepreamble and the frequency domain resource used to send the firstidentification information, the frequency domain resource used to sendthe first identification information, and receive the firstidentification information on the frequency domain resource, to improveefficiency of receiving, by the network device, the first message.

There is the mapping relationship between the preamble and the OCC orthere is the mapping relationship between the frequency domain resourceused to send the preamble and the frequency domain resource used to sendthe first identification information, which may be provided in astandard, or may be configured by the network device in RMSI/OSI.

In this embodiment, that there is the mapping relationship between thefrequency domain resource used to send the preamble and the frequencydomain resource used to send the first identification information mayinclude two cases:

-   -   Case 1: The frequency domain resource used to send the preamble        sequence is the same as the frequency domain resource used to        send the first identification information. In other words, the        preamble and the first identification information are sent on a        same frequency domain resource.    -   Case 2: There is a preset offset between the frequency domain        resource used to send the preamble sequence and the frequency        domain resource used to send the first identification        information. The preset offset is configured by the network        device according to an actual requirement, or is provided in a        standard. Offsets between frequency domain resources        corresponding to different preamble sequences and frequency        domain resources corresponding to different first identification        information may be the same or different.

In still some other implementations, the first message in thisembodiment further includes a sequence number of the preamble sequence.In this way, in a scenario in which there is no mapping relationshipbetween the preamble and the OCC, when the network device has notreceived the preamble but has received the first identificationinformation and the sequence number of the preamble, the network devicemay determine an RA-RNTI of the terminal device based on the OCC used toscramble the first identification information and a sequence number of atime-frequency resource of the preamble (it is assumed that thefrequency domain resource used to send the first identificationinformation is the same as the frequency domain resource used to sendthe preamble). Then, the network device indicates, by using a PDCCHscrambled by using the RA-RNTI, the terminal device to resend thepreamble or the preamble and the first identification information basedon the sequence number of the preamble.

Optionally, in this embodiment, the sequence number of the preamblesequence and the first identification information are sent on a sametime-frequency resource, that is, both the sequence number of thepreamble sequence and the first identification information are carriedon a PUSCH. In this way, when obtaining either of the firstidentification information and the sequence number of the preamblethrough blind detection, the network device can receive the other, toreduce complexity of blind detection and reduce a resource occupied bythe first message.

In yet some other implementations, the first message further includes asequence number of the preamble sequence and a sequence number of thefrequency domain resource used to send the preamble sequence (forexample, a sequence number of the foregoing interlace). In this way, ina scenario in which there is no mapping relationship between thepreamble and the OCC, and the frequency domain resource used to send thefirst identification information is different from the frequency domainresource used to send the preamble sequence, when the network device hasnot received the preamble but has received the first identificationinformation, the sequence number of the preamble, and the sequencenumber of the frequency domain resource used to send the preamblesequence, the network device may determine an RA-RNTI of the terminaldevice based on the OCC used to scramble the first identificationinformation and the sequence number of the frequency domain resourceused to send the preamble. Then, the network device indicates, by usinga PDCCH scrambled by using the RA-RNTI, the terminal device to resendthe preamble or the preamble and the first identification informationbased on the sequence number of the preamble.

Optionally, in this embodiment, all of the sequence number of thepreamble sequence, the first identification information, and thesequence number of the frequency domain resource used to send thepreamble sequence are sent on a same time-frequency resource, that is,all of the sequence number of the preamble sequence, the firstidentification information, and the sequence number of the frequencydomain resource used to send the preamble sequence are carried on aPUSCH. In this way, when obtaining, through blind detection, any one ofthe first identification information, the sequence number of thepreamble, and the sequence number of the frequency domain resource usedto send the preamble sequence, the network device can receive the othertwo, to reduce complexity of blind detection of the network device andreduce a resource occupied by the first message.

A length of the preamble is not limited in this embodiment. For example,the preamble may be a sequence with a length of 139, or may be a DMRSsequence with a length of 120, for example, a DMRS sequence in Multefire(another cellular standard operating on an unlicensed frequency band).

In this embodiment, the frequency domain resource and a time domainresource that are used for the preamble may be provided in a standard,or may be configured by the network device in RMSI/OSI.

In some implementations of this embodiment, if an allocation manner ofthe frequency domain resource used to send the preamble is an interlacedresource allocation manner, a configuration manner of the frequencydomain resource of the preamble is shown in FIG. 7 .

For example, as shown in FIG. 7 , it is assumed that an allocationmanner of a frequency domain resource used to send the first message isan interlaced resource allocation manner, duration of the first messageis 14 symbols, the preamble lasts for two symbols, a channel bandwidthis 20 MHz, and a length of the preamble is 139. As shown in FIG. 7 , thepreamble occupies, in frequency domain, two extra RBs and one interlace(for example, interlace 5) that includes 10 RBs, and each RB includes 12subcarriers. The two extra RBs may be two RBs in another interlace(namely, an interlace other than the interlace 5), or may be any two ofsix RBs other than the interlaces (it can be learned from the foregoingthat 20 MHz includes 106 RBs, 100 RBs are divided into 10 interlaces,and six RBs remain). In this embodiment, when the two extra RBs are RBsin another interlace, six interlaces include 6*10*12=720 subcarriers,and a length of five groups of preambles is 139*5=695. Therefore, thesix interlaces may be used to send five groups of preambles. It can belearned from the foregoing that a quantity of preambles sent on achannel can be increased by using the interlaced resource allocationmanner, to increase a capacity of the channel.

In FIG. 7 , interlaced resource allocation may be alternatively uneven,that is, an interval between every two adjacent RBs in an interlace maynot always be the same, so that the network device can estimate a timingadvance more precisely.

Still referring to FIG. 7 , in this embodiment, the interlaced resourceallocation manner is used, so that a capacity of a communications systemcan be increased. For example, in an example, when 10 interlaces areused to transmit 10 different groups of preambles, each group mayinclude six different preambles, and each preamble corresponds to adifferent OCC. When a PUSCH lasts for 12 symbols, a quantity ofavailable OCCs is 12. In this case, the communications system cansupport a case in which 10*6=60 different terminal devices performrandom access at the same time without collision.

In another example, when 10 interlaces are used to transmit fivedifferent groups of preambles, each group may include 12 differentpreambles, and each preamble corresponds to a different OCC. When aPUSCH lasts for 12 symbols, a quantity of available OCCs is 12. In thiscase, the communications system can support a case in which 5*12=60different UEs perform random access without collision. In addition, inthis scenario, each preamble corresponds to two interlaces. Therefore,each preamble can be repeatedly sent twice, to increase a sendingsuccess rate of the preamble.

It should be noted that it can be learned from the foregoing that if thefrequency domain resource used to send the preamble is different fromthe frequency domain resource used to send the first identificationinformation, a sequence number that is of the frequency domain resourceused to send the first message and that is used to calculate the RA-RNTImay be a sequence number of the frequency domain resource used to sendthe first identification information, or a sequence number of thefrequency domain resource used to send the preamble, or an average valueor a sum value of the sequence number of the frequency domain resourceused to send the first identification information and the sequencenumber of the frequency domain resource used to send the preamble.Similarly, a sequence number that is of a time domain resource used forthe first message and that is used to calculate the RA-RNTI may be asequence number of a time domain resource used to send the firstidentification information, or may be a sequence number of the timedomain resource used to send the preamble.

-   -   S602. The network device receives the first message sent by the        terminal device.

In an example, if there is the mapping relationship between the preamblesequence and the OCC, S602 may include S602 a and S602 b.

-   -   S602 a. The network device blindly detects a time-frequency        resource used for random access, and obtains the preamble        sequence through detection.    -   S602 b. The network device receives, based on the mapping        relationship between the preamble sequence obtained through        detection and the OCC, the first identification information        scrambled by using the OCC.

Specifically, the preamble is a sequence, and is easily obtained by thenetwork device through detection. After the network device obtains thepreamble through detection, for example, preamble 1, because there is amapping relationship between preamble 1 and OCC 1, the network devicecan determine that the OCC used to scramble the first identificationinformation is OCC 1. The network device performs blind detection byusing the OCC 1 on the time-frequency resource used for random access,and can receive the first identification information sent by theterminal device, to reduce complexity of blindly detecting, by thenetwork device, the first identification information, quickly detect thefirst identification information, and further reduce a random accessdelay.

In another example, if there is the mapping relationship between thefrequency domain resource used to send the preamble sequence and thefrequency domain resource used to send the first identificationinformation, S602 may include S602 c and S602 d.

-   -   S602 c. The network device blindly detects a time-frequency        resource used for random access, and obtains, through detection,        the frequency domain resource used to send the preamble        sequence.    -   S602 d. The network device obtains, based on the mapping        relationship between the frequency domain resource used to send        the preamble sequence and the frequency domain resource used to        send the first identification information, the frequency domain        resource used to send the first identification information, and        receives the first identification information on the frequency        domain resource used to send the first identification        information.

Specifically, after obtaining the preamble through detection, thenetwork device may obtain the frequency domain resource used to send thepreamble. In this way, the network device can obtain, based on themapping relationship between the frequency domain resource used to sendthe preamble and the frequency domain resource used to send the firstidentification information, the frequency domain resource used to sendthe first identification information. The network device receives thefirst identification information on the frequency domain resource usedto send the first identification information, to reduce complexity ofblindly detecting, by the network device, the first identificationinformation, quickly receive the first identification information, andfurther reduce a random access delay.

In this embodiment, a result of receiving, by the network device, thefirst message and a subsequent action include the following severalcases:

In a first case, when the network device has not received the preambleand the first identification information in the first message, currentrandom access fails, and the terminal device resends, in a nextavailable random access channel (RACH) resource window, the preamble andthe scrambled first identification information.

In a second case, when the network device has received the preamble andthe first identification information in the first message, the networkdevice sends a second message in a random access response message (RAR)window to reply to the terminal device.

In a third case, when the network device successfully receives thepreamble sent by the terminal device, but fails to decode the firstidentification information, the network device may obtain, based on themapping relationship between the preamble and the OCC, the OCC used toscramble the first identification information, and calculate the RA-RNTIof the terminal device based on the OCC and a sequence number of atime-frequency resource of the preamble. The network device mayindicate, by using the PDCCH scrambled by using the RA-RNTI, theterminal device to resend the first identification information. To bespecific, the sequence number of the frequency domain resource used tosend the first identification information (for example, a sequencenumber of an interlace used to send the first identificationinformation) and the time domain resource used to send the firstidentification information are added to a media access control controlelement (MAC CE) of a PDSCH indicated by the PDCCH, and optionally,information about the OCC used to scramble the first identificationinformation may be further added.

In a fourth case, when the network device successfully receives thefirst identification information sent by the terminal device, but failsto decode the preamble, the following is included.

If there is the mapping relationship between the preamble and the OCC,the network device obtains the OCC used to scramble the firstidentification information, obtains, based on the mapping relationshipbetween the preamble and the OCC, the sequence number of the preamblecorresponding to the OCC, and calculates, based on the OCC and thesequence number of the time-frequency resource of the preamble, theRA-RNTI of the terminal device sending the first message. The networkdevice may indicate, by using the PDCCH scrambled by using the RA-RNTI,the terminal device to resend the preamble or the preamble and the firstidentification information. To be specific, the sequence number of thefrequency domain resource used to send the preamble (for example, asequence number of an interlace used to send the preamble), the timedomain resource, and the sequence number of the preamble correspondingto the OCC are added to a MAC CE of a PDSCH indicated by the PDCCH.

If there is no mapping relationship between the preamble and the OCC,the first message includes the sequence number of the preamble, and thefrequency domain resource used to send the first identificationinformation is the same as the frequency domain resource used to sendthe preamble, the network device may determine the RA-RNTI of theterminal device based on the OCC used to scramble the firstidentification information and the sequence number of the time-frequencyresource of the preamble. Then, the network device indicates, by usingthe PDCCH scrambled by using the RA-RNTI, the terminal device to resendthe preamble or the preamble and the first identification information.To be specific, the sequence number of the frequency domain resourceused to send the preamble, the time domain resource, and the sequencenumber of the preamble are added to a MAC CE of a PDSCH indicated by thePDCCH.

It should be noted that both of the foregoing cases are for a scenarioin which the frequency domain resource used to send the firstidentification information is the same as the frequency domain resourceused to send the preamble.

If there is no mapping relationship between the preamble and the OCC,the first message includes the sequence number of the preamble and thesequence number of the frequency domain resource used to send thepreamble sequence, and the frequency domain resource used to send thefirst identification information is different from the frequency domainresource used to send the preamble, the network device may determine theRA-RNTI of the terminal device based on the OCC used to scramble thefirst identification information and the sequence number of thefrequency domain resource used to send the preamble. Then, the networkdevice indicates, by using the PDCCH scrambled by using the RA-RNTI, theterminal device to resend the preamble or the preamble and the firstidentification information. To be specific, the sequence number of thefrequency domain resource used to send the preamble, the time domainresource, and the sequence number of the preamble are added to a MAC CEof a PDSCH indicated by the PDCCH.

-   -   S603. The network device scrambles the PDCCH by using the        RA-RNTI of the terminal device, and sends the second message to        the terminal device on a time-frequency resource indicated by        the scrambled PDCCH, where the second message includes a timing        advance, and the RA-RNTI is determined by using the OCC used to        scramble the first identification information.

The second message in this embodiment not only includes identificationinformation of one or more terminal devices that succeed in randomaccess, but also includes the timing advance obtained in the foregoingstep.

In this step, a method for generating, by the network device, the timingadvance based on the preamble sequence is the same as an existingmethod, and details are not described in this embodiment.

In this embodiment, the network device generates the timing advance forthe terminal device, adds the timing advance to the second message, andsends the second message to the terminal device. In this way, whensending a message to the network device next time, the terminal devicesends the message to the network device based on the timing advance, toimplement uplink synchronization.

-   -   S604. After receiving the PDCCH that is scrambled by using the        RA-RNTI and that is sent by the network device, the terminal        device sending the first message receives, based on the PDCCH,        the second message sent by the network device.    -   S605. The terminal device sending the first message sends a        third message or a fourth message to the network device.

For a specific process of S604 and S605, refer to descriptions of theforegoing embodiments, and details are not described herein again.

In the random access method provided in this embodiment, the firstidentification information of the terminal device and the preamble areadded to the first message, so that the network device generates thetiming advance for the terminal device, to enable the terminal device tosend the message to the network device based on the timing advance, toimprove uplink synchronization precision of each terminal device.

In some implementations, the first message in this embodiment furtherincludes information about an optimal downlink transmit beam of thenetwork device.

In some implementations, for example, when the communications system inthis embodiment is a high frequency system, the first message in thisembodiment may further carry the information about the optimal downlinktransmit beam of the network device, so that the network device sendsthe second message to the terminal device on the optimal downlinktransmit beam, to improve efficiency of sending the second message.

Optionally, the information about the optimal downlink transmit beam ofthe network device may be a sequence number of the optimal downlinktransmit beam of the network device.

In some implementations, the first message in this embodiment furtherincludes information about at least one downlink transmit beam of thenetwork device.

To be specific, in this embodiment, the first message includes theinformation about the at least one downlink transmit beam of the networkdevice. In this way, the network device can select one downlink transmitbeam from the at least one downlink transmit beam to send the secondmessage.

Optionally, the information about the at least one downlink transmitbeam is a sequence number of the at least one downlink transmit beam.

It may be understood that in the foregoing embodiments, operations andsteps implemented by the terminal device may be implemented by acomponent (for example, a chip or a circuit) that may be used for theterminal device, and operations and steps implemented by the networkdevice may be implemented by a component (for example, a chip or acircuit) that may be used for the network device. This is not limited inthis embodiment of this application.

FIG. 8 is a schematic structural diagram of a random access deviceaccording to an embodiment of this application. As shown in FIG. 8 , therandom access device 900 in this embodiment may be a terminal device (ora component that may be used for the terminal device) or a networkdevice (or a component that may be used for the network device)mentioned in the foregoing method embodiments. The random access devicemay be configured to implement the method corresponding to the terminaldevice or the network device described in the foregoing methodembodiments. For details, refer to the descriptions in the foregoingmethod embodiments.

The random access device 900 may include one or more processors 901. Theprocessor 901 may be alternatively referred to as a processing unit, andmay implement a specific control or processing function. The processor901 may be a general purpose processor, a dedicated processor, or thelike, for example, may be a baseband processor or a central processingunit. The baseband processor may be configured to process acommunications protocol and communication data, and the centralprocessing unit may be configured to control the communicationsapparatus, execute a software program, and process data of the softwareprogram.

In an optional design, the processor 901 may further store aninstruction 903 or data (for example, intermediate data). Theinstruction 903 may be run by the processor, to enable the random accessdevice 900 to perform the method corresponding to the terminal device orthe network device described in the foregoing method embodiments.

In still another possible design, the random access device 900 mayinclude a circuit, and the circuit may implement a sending, receiving,or communication function in the foregoing method embodiments.

Optionally, the random access device 900 may include one or morememories 902, and the memory 902 may store an instruction 904. Theinstruction may be run on the processor 901, to enable the random accessdevice 900 to perform the method described in the foregoing methodembodiments.

Optionally, the memory 902 may further store data. The processor 901 andthe memory 902 may be disposed separately, or may be integratedtogether.

Optionally, the random access device 900 may further include a receiver905 and a transmitter 906. The receiver 905 and the transmitter 906 maybe disposed separately, or may be integrated together. The processor 901may be referred to as a processing unit, and control a random accessapparatus (a terminal device or a network device). The receiver 905 maybe referred to as a receiving unit, a receiving circuit, or the like,and is configured to implement a receiving function of the random accessdevice. The transmitter 906 may be referred to as a sending unit, asending circuit, or the like, and is configured to implement a sendingfunction of the random access device.

In a design, if the random access device 900 is configured to implementoperations corresponding to the terminal device in the foregoingembodiments, for example, the transmitter 906 may send a first messageto the network device, where the first message includes firstidentification information scrambled by using an orthogonal cover codeOCC, and the first message is used by the terminal device correspondingto the first identification information to request random access to thenetwork device, and the receiver 905 may receive a second message sentby the network device, where the second message includes identificationinformation of one or more terminal devices that succeed in randomaccess; and determine, based on whether the identification informationof the one or more terminal devices includes the first identificationinformation, whether the random access succeeds.

Optionally, an RA-RNTI of the terminal device is determined by using theOCC used to scramble the first identification information.

For specific implementation processes of the transmitter 906, thereceiver 905, and the processor 901, refer to related descriptions inthe foregoing embodiments. Details are not described herein again.

In another design, if the random access device is configured toimplement operations corresponding to the network device in theforegoing embodiments, for example, the receiver is configured toreceive a first message sent by the terminal device, and the transmitteris configured to send a second message to the terminal device based onthe first message. The first message includes first identificationinformation scrambled by using an OCC, the first message is used by theterminal device corresponding to the first identification information torequest random access to the network device, the second message includesidentification information of one or more terminal devices that succeedin random access, and the identification information of the one or moreterminal devices includes the first identification information.

Optionally, the transmitter is specifically configured to scramble aPDCCH by using a RA-RNTI of the terminal device, and send the secondmessage to the terminal device on a time-frequency resource indicated bythe scrambled PDCCH, where the RA-RNTI is determined by using the OCCused to scramble the first identification information.

For specific implementation processes of the transmitter 906, thereceiver 905, and the processor 901, refer to related descriptions ofthe network device in the foregoing embodiments. Details are notdescribed herein again.

The processor 901, the receiver 905, and the transmitter 906 describedin this application may be implemented on an integrated circuit (IC), ananalog IC, a radio frequency integrated circuit (RFIC), a mixed-signalIC, an application specific integrated circuit (ASIC), a printed circuitboard (PCB), an electronic device, and the like. The processor 901, thereceiver 905, and the transmitter 906 may also be manufactured by usingvarious 1C process technologies, for example, a complementary metaloxide semiconductor (CMOS), an nMetal-oxide-semiconductor (NMOS), aP-channel metal oxide semiconductor (PMOS), a bipolar junctiontransistor (BJT), a bipolar CMOS (BiCMOS), silicon-germanium (SiGe),gallium arsenide (GaAs), and the like.

In the descriptions of the foregoing embodiments, the random accessdevice 900 is described by using the terminal device or the networkdevice as an example. However, a range of the random access device inthis application is not limited to the terminal device or the networkdevice, and a structure of the random access device may not be limitedto FIG. 8 . The random access device 900 may be an independent device ormay be a part of a large device. For example, the device may be:

-   -   (1) an independent integrated circuit IC, chip, or chip system        or subsystem;    -   (2) a set of one or more ICs, where optionally, the IC set may        further include a storage component configured to store data        and/or an instruction;    -   (3) an ASIC such as a modem (MSM);    -   (4) a module that can be embedded in another device;    -   (5) a receiver, a terminal, a cellular phone, a wireless device,        a handheld device, a mobile unit, a network device, or the like;        or    -   (6) another device.

FIG. 9 is a schematic structural diagram of a terminal device accordingto an embodiment of this application. The terminal device may be theterminal device described in the foregoing embodiments of thisapplication. For ease of description, FIG. 9 shows only main componentsof the terminal device. As shown in FIG. 9 , the terminal device 1000includes a processor, a memory, a control circuit, an antenna, and aninput/output apparatus. The processor is mainly configured to: process acommunications protocol and communications data, control the entireterminal, execute a software program, and process data of the softwareprogram. The memory is mainly configured to store the software programand the data. A radio frequency circuit is mainly configured to: performconversion between a baseband signal and a radio frequency signal, andprocess the radio frequency signal. The antenna is mainly configured toreceive and transmit a radio frequency signal in an electromagnetic waveform. The input/output apparatus, such as a touchscreen, a displayscreen, or a keyboard, is mainly configured to receive data entered by auser and output data to the user.

After the terminal is powered on, the processor can read the softwareprogram in a memory, interpret and execute an instruction of thesoftware program, and process the data of the software program. Whendata needs to be sent in a wireless manner, after performing basebandprocessing on the to-be-sent data, the processor outputs a basebandsignal to the radio frequency circuit. After performing radio frequencyprocessing on the baseband signal, the radio frequency circuit sends aradio frequency signal in an electromagnetic wave form by using theantenna. When data is sent to the terminal, the radio frequency circuitreceives a radio frequency signal by using the antenna, converts theradio frequency signal into a baseband signal, and outputs the basebandsignal to the processor. The processor converts the baseband signal intodata, and processes the data.

A person skilled in the art may understand that for ease of description,FIG. 9 shows only one memory and only one processor. An actual terminaldevice may have a plurality of processors and a plurality of memories.The memory may also be referred to as a storage medium, a storagedevice, or the like. This is not limited in this embodiment of thisapplication.

In an optional implementation, the processor may include a basebandprocessor and a central processing unit. The baseband processor ismainly configured to process the communications protocol and thecommunications data, and the central processing unit is mainlyconfigured to: control the entire terminal, execute the softwareprogram, and process the data of the software program. Functions of thebaseband processor and the central processing unit are integrated intothe processor in FIG. 9 . A person skilled in the art may understandthat the baseband processor and the central processing unit each may bean independent processor, and are interconnected by using a technologysuch as a bus. A person skilled in the art may understand that theterminal device may include a plurality of baseband processors to adaptto different network standards, the terminal may include a plurality ofcentral processing units to improve a processing capability of theterminal, and the components of the terminal device may be connected byusing various buses. The baseband processor may also be expressed as abaseband processing circuit or a baseband processing chip. The centralprocessing unit may also be expressed as a central processing circuit ora central processing chip. A function of processing the communicationsprotocol and the communications data may be built in the processor, ormay be stored in the storage unit in a form of a software program. Theprocessor executes the software program to implement a basebandprocessing function.

In an example, the antenna and the control circuit that have receivingand sending functions may be considered as a transceiver 1001 of theterminal device 1000. As shown in FIG. 9 , the terminal device 1000includes the transceiver 1001 and the processor 1002. Optionally, acomponent that is in the transceiver unit 1001 and is configured toimplement a receiving function may be considered as a receiver, and acomponent that is in the transceiver unit 1001 and is configured toimplement a sending function may be considered as a transmitter, thatis, the transceiver unit 1001 includes the receiver and the transmitter.For example, the receiver may also be referred to as a receiver, areceiving circuit, or the like, and the transmitter may be referred toas a transmitter, a sending circuit, or the like.

FIG. 10 is a schematic structural diagram of a random access apparatusaccording to an embodiment of this application. The random accessapparatus may be a terminal device, or may be a component (for example,an integrated circuit or a chip) of a terminal device, or may be anothercommunications module, configured to implement an operation or a step ofthe terminal device in the foregoing method embodiments. The randomaccess apparatus 700 may include a sending module 701, a receivingmodule 702, and a processing module 703.

The sending module 701 is configured to send a first message to anetwork device, where the first message includes first identificationinformation scrambled by using an OCC, and the first message is used bya terminal device corresponding to the first identification informationto request random access to the network device.

The receiving module 702 is configured to receive a second message sentby the network device, where the second message includes identificationinformation of one or more terminal devices that succeed in randomaccess.

The processing module 703 is configured to determine, based on whetherthe identification information of the one or more terminal devicesincludes the first identification information, whether the random accesssucceeds.

The random access apparatus in this embodiment may be configured toexecute the technical solutions of the terminal device in the foregoingmethod embodiments. The implementation principles and technical effectsare similar, and details are not further described herein.

In some implementations, the first message in this embodiment furtherincludes a preamble sequence.

Optionally, there is a mapping relationship between the preamblesequence and the OCC, or there is a mapping relationship between afrequency domain resource used to send the preamble sequence and afrequency domain resource used to send the first identificationinformation.

Optionally, the frequency domain resource used to send the preamblesequence is the same as the frequency domain resource used to send thefirst identification information, or there is a preset offset betweenthe frequency domain resource used to send the preamble sequence and thefrequency domain resource used to send the first identificationinformation.

In some other implementations, a random access radio network temporaryidentifier RA-RNTI of the terminal device is determined by using the OCCused to scramble the first identification information.

Optionally, the RA-RNTI is determined by using the OCC used to scramblethe first identification information, a sequence number of a frequencydomain resource used to send the first message, and a sequence number ofa time domain resource used to send the first message and/or a totalquantity of OCCs available for the terminal device.

Optionally, if an allocation manner of a frequency domain resource usedto send the first message is an interlaced resource allocation manner, asequence number of the frequency domain resource used to send the firstmessage is a sequence number, of the frequency domain resource used tosend the first message, in interlaced resource allocation.

Optionally, the sending module is further configured to: if theidentification information of the one or more terminal devices includesthe first identification information, send a third message to thenetwork device, where the third message is used to indicate that theterminal device corresponding to the first identification informationsucceeds in the random access; or if the identification information ofthe one or more terminal devices does not include the firstidentification information, or the second message fails to be decoded,send a fourth message to the network device, to enable the networkdevice to resend the second message to the terminal device based on thefourth message, where the fourth message is used to indicate that theterminal device corresponding to the first identification informationfails in the random access.

Optionally, the first message further includes a sequence number of thepreamble sequence, or the first message further includes a sequencenumber of the preamble sequence and a sequence number of a frequencydomain resource used to send the preamble sequence.

Optionally, the sequence number of the preamble sequence and the firstidentification information are sent on a same time-frequency resource,or

-   -   all of the sequence number of the preamble sequence, the first        identification information, and the sequence number of the        frequency domain resource used to send the preamble sequence are        sent on a same time-frequency resource.

Optionally, the first message further includes information about anoptimal downlink transmit beam of the network device.

Optionally, the second message further includes configurationinformation of a PUCCH used to send the third message or used to sendthe fourth message.

Optionally, the first identification information is a global uniquenetwork identifier S-TMSI of the terminal device.

Optionally, if the terminal device is out of synchronization in theuplink and synchronized in the downlink, the first identificationinformation is a cell radio network temporary identifier C-RNTI of theterminal device.

Optionally, the sending module 701 is further configured to: if atime-frequency resource available for sending the first message isgreater than a time-frequency resource occupied by the first message,perform LBT in a plurality of symbol locations in the time-frequencyresource available for sending the first message, and send the firstmessage in the first symbol location in which LBT succeeds.

Optionally, the receiving module 702 is specifically configured to:after receiving a PDCCH that is scrambled by using the RA-RNTI and thatis sent by the network device, receive, based on the PDCCH, the secondmessage sent by the network device.

Optionally, the processing module 703 is further configured to: randomlyselect an OCC from a plurality of OCCs available for the terminaldevice, and scramble the first identification information by using theselected OCC.

The sending module 701 is configured to send, to the network device on arandomly selected time-frequency resource used for random access, thefirst message carrying the scrambled first identification information.

Optionally, the second message further includes a timing advance timingadvance.

The random access apparatus in this embodiment may be configured toexecute the technical solutions of the terminal device in the foregoingmethod embodiments. The implementation principles and technical effectsare similar, and details are not further described herein.

FIG. 11 is a schematic structural diagram of a random access apparatusaccording to an embodiment of this application. The random accessapparatus may be a network device, or may be a component (for example,an integrated circuit or a chip) of a network device, or may be anothercommunications module, configured to implement an operation of thenetwork device in the foregoing method embodiments. The random accessapparatus 800 may include a receiving module 801 and a sending module802.

The receiving module 801 is configured to receive a first message sentby a terminal device, where the first message includes firstidentification information scrambled by using an OCC, and the firstmessage is used by the terminal device corresponding to the firstidentification information to request random access to the networkdevice.

The sending module 802 is configured to send a second message to theterminal device based on the first message, where the second messageincludes identification information of one or more terminal devices thatsucceed in random access, and the identification information of the oneor more terminal devices includes the first identification information.

The random access apparatus in this embodiment may be configured toexecute the technical solutions of the network device in the foregoingmethod embodiments. The implementation principles and technical effectsare similar, and details are not further described herein.

In some implementations, the first message further includes a preamblesequence.

Optionally, there is a mapping relationship between the preamblesequence and the OCC, or there is a mapping relationship between afrequency domain resource used to send the preamble sequence and afrequency domain resource used to send the first identificationinformation.

Optionally, the frequency domain resource used to send the preamblesequence is the same as the frequency domain resource used to send thefirst identification information, or there is a preset offset betweenthe frequency domain resource used to send the preamble sequence and thefrequency domain resource used to send the first identificationinformation.

Optionally, if there is the mapping relationship between the preamblesequence and the OCC, the receiving module 801 is specificallyconfigured to: blindly detect a time-frequency resource used for randomaccess, detect the preamble sequence, and receive, based on the mappingrelationship between the preamble sequence and the OCC, the firstidentification information scrambled by using the OCC.

Optionally, if there is the mapping relationship between the frequencydomain resource used to send the preamble sequence and the frequencydomain resource used to send the first identification information, thereceiving module 801 is specifically configured to: blindly detect atime-frequency resource used for random access, obtain, throughdetection, the frequency domain resource used to send the preamblesequence, obtain, based on the mapping relationship between thefrequency domain resource used to send the preamble sequence and thefrequency domain resource used to send the first identificationinformation, the frequency domain resource used to send the firstidentification information, and receive the first identificationinformation on the frequency domain resource used to send the firstidentification information.

Optionally, the sending module 802 is specifically configured toscramble a PDCCH by using a random access radio network temporaryidentifier RA-RNTI of the terminal device, and send the second messageto the terminal device on a time-frequency resource indicated by thescrambled PDCCH, where the RA-RNTI is determined by using the OCC usedto scramble the first identification information.

Optionally, the RA-RNTI is determined by using the OCC used to scramblethe first identification information, a sequence number of a frequencydomain resource used to send the first message, and a sequence number ofa time domain resource used to send the first message and/or a totalquantity of OCCs available for the terminal device.

Optionally, if an allocation manner of the frequency domain resourceused to send the first message is an interlaced resource allocationmanner, the sequence number of the frequency domain resource used tosend the first message is a sequence number, of the frequency domainresource used to send the first message, in interlaced resourceallocation.

Optionally, the receiving module 801 is further configured to receive athird message sent by the terminal device, where the third message isused to indicate that the terminal device corresponding to the firstidentification information succeeds in the random access; or configuredto receive a fourth message sent by the terminal device, where thefourth message is used to indicate that the terminal devicecorresponding to the first identification information fails in therandom access; and

-   -   the sending module 802 is further configured to resend the        second message to the terminal device based on the fourth        message.

Optionally, the first message further includes a sequence number of thepreamble sequence, or the first message further includes a sequencenumber of the preamble sequence and a sequence number of a frequencydomain resource used to send the preamble sequence.

Optionally, the sequence number of the preamble sequence and the firstidentification information are sent on a same time-frequency resource,or

-   -   all of the sequence number of the preamble sequence, the first        identification information, and the sequence number of the        frequency domain resource used to send the preamble sequence are        sent on a same time-frequency resource.

Optionally, the first message further includes information about anoptimal downlink transmit beam of the network device.

Optionally, the second message further includes configurationinformation of a PUCCH used to send the third message or used to sendthe fourth message.

Optionally, the first identification information is a global uniquenetwork identifier S-TMSI of the terminal device.

Optionally, if the terminal device is out of synchronization in theuplink and synchronized in the downlink, the first identificationinformation is a cell radio network temporary identifier C-RNTI of theterminal device.

Optionally, the second message further includes a timing advancegenerated based on the preamble sequence.

The random access apparatus in this embodiment may be configured toexecute the technical solutions of the network device in the foregoingmethod embodiments. The implementation principles and technical effectsare similar, and details are not further described herein.

It should be noted that, division into modules in the embodiments ofthis application is an example, and is merely a logical functiondivision. In actual implementation, another division manner may be used.Functional modules in the embodiments of this application may beintegrated into one processing module, or each of the modules may existalone physically, or two or more modules are integrated into one module.The integrated module may be implemented in a form of hardware, or maybe implemented in a form of a software functional module.

When the integrated module is implemented in the form of a softwarefunctional module and sold or used as an independent product, theintegrated unit may be stored in a computer-readable storage medium.Based on such an understanding, the technical solutions of thisapplication essentially, or the part contributing to the prior art, orall or some of the technical solutions may be implemented in a form of asoftware product. The computer software product is stored in a storagemedium and includes several instructions for instructing a computerdevice (which may be a personal computer, a server, a network device, orthe like) or a processor to perform all or some of the steps of themethods described in the embodiments of this application. The foregoingstorage medium includes: any medium that can store program code, such asa USB flash drive, a removable hard disk, a read-only memory (ROM), arandom access memory (RAM), a magnetic disk, or an optical disc.

All or some of the foregoing embodiments may be implemented by usingsoftware, hardware, firmware, or any combination thereof. When softwareis used to implement the embodiments, the embodiments may be implementedcompletely or partially in a form of a computer program product. Thecomputer program product includes one or more computer instructions.When the computer program instructions are loaded and executed on acomputer, the procedure or functions according to the embodiments ofthis application are all or partially generated. The computer may be ageneral-purpose computer, a dedicated computer, a computer network, orother programmable apparatuses. The computer instructions may be storedin a computer-readable storage medium or may be transmitted from acomputer-readable storage medium to another computer-readable storagemedium. For example, the computer instructions may be transmitted from awebsite, computer, server, or data center to another website, computer,server, or data center in a wired (for example, a coaxial cable, anoptical fiber, or a digital subscriber line (DSL)) or wireless (forexample, infrared, radio, or microwave) manner. The computer-readablestorage medium may be any usable medium accessible by a computer, or adata storage device, such as a server or a data center, integrating oneor more usable media. The usable medium may be a magnetic medium (forexample, a floppy disk, a hard disk, or a magnetic tape), an opticalmedium (for example, a DVD), a semiconductor medium (for example, asolid-state drive (Solid-State Disk, SSD)), or the like.

What is claimed is:
 1. A random access method, comprising: sending afirst message to a network device, wherein the first message comprisesfirst identification information scrambled by using an orthogonal covercode, where the first message is sent by a terminal device correspondingto the first identification information to request random access to thenetwork device, and where a random access radio network temporaryidentifier of the terminal device is determined by using the orthogonalcover code; and receiving a second message sent by the network device,wherein the second message comprises identification information of oneor more terminal devices that succeed in random access, and determining,based on whether the identification information of the one or moreterminal devices comprises the first identification information, whetherthe random access succeeds.
 2. The method according to claim 1, whereinthe first message further comprises a preamble sequence.
 3. The methodaccording to claim 2, wherein there is a mapping relationship betweenthe preamble sequence and the orthogonal cover code, or there is amapping relationship between a frequency domain resource used to sendthe preamble sequence and a frequency domain resource used to send thefirst identification information.
 4. The method according to claim 3,wherein the frequency domain resource used to send the preamble sequenceis the same as the frequency domain resource used to send the firstidentification information, or there is a preset offset between thefrequency domain resource used to send the preamble sequence and thefrequency domain resource used to send the first identificationinformation.
 5. The method according to claim 2, wherein the firstmessage further comprises a sequence number of the preamble sequence, orthe first message further comprises the sequence number of the preamblesequence and a sequence number of a frequency domain resource used tosend the preamble sequence.
 6. The method according to claim 5, whereinthe sequence number of the preamble sequence and the firstidentification information are sent on a same time-frequency resource,or the sequence number of the preamble sequence, the firstidentification information, and the sequence number of the frequencydomain resource used to send the preamble sequence are all sent on thesame time-frequency resource.
 7. The method according to claim 2,wherein the second message further comprises a timing advance.
 8. Themethod according to claim 1, wherein the random access radio networktemporary identifier is determined by using the orthogonal cover codeused to scramble the first identification information, a sequence numberof a frequency domain resource used to send the first message, and asequence number of a time domain resource used to send the first messageand/or a total quantity of orthogonal cover codes available for theterminal device.
 9. The method according to claim 1, wherein if anallocation method of a frequency domain resource used to send the firstmessage is an interlaced resource allocation method, a sequence numberof the frequency domain resource used to send the first message is asequence number of a selected interlace resource used to send the firstmessage.
 10. The method according to claim 1, wherein after thereceiving the second message sent by the network device, the methodfurther comprises: if the identification information of the one or moreterminal devices comprises the first identification information, sendinga third message to the network device, wherein the third messageindicates that the terminal device corresponding to the firstidentification information succeeds in the random access; or if theidentification information of the one or more terminal devices does notcomprise the first identification information of the terminal devicesending the first message, or the second message fails to be decoded,sending a fourth message to the network device, to enable the networkdevice to resend the second message to the terminal device based on thefourth message, wherein the fourth message indicates that the terminaldevice corresponding to the first identification information fails inthe random access.
 11. The method according to claim 1, wherein thefirst message further comprises information about an optimal downlinktransmit beam of the network device.
 12. The method according to claim10, wherein the second message further comprises configurationinformation of a physical uplink control channel used to send the thirdmessage or used to send the fourth message.
 13. The method according toclaim 1, wherein the first identification information is a global uniquenetwork identifier of the terminal device.
 14. The method according toclaim 1, wherein if the terminal device is out of synchronization in theuplink and synchronized in the downlink, the first identificationinformation is a cell radio network temporary identifier of the terminaldevice.
 15. The method according to claim 1, wherein if a time-frequencyresource available for sending the first message is greater than atime-frequency resource occupied by the first message, sending the firstmessage to the network device comprises: performing listen before talkin a plurality of symbol locations in the time-frequency resourceavailable for sending the first message, and sending the first messagein the first symbol location in which listen before talk succeeds. 16.The method according to claim 1, wherein receiving the second messagesent by the network device comprises: after receiving a physicaldownlink control channel that is scrambled by using the random accessradio network temporary identifier and that is sent by the networkdevice, receiving, based on the physical downlink control channel, thesecond message sent by the network device.
 17. The method according toclaim 1, wherein sending the first message to the network devicecomprises: randomly selecting an orthogonal cover code from a pluralityof orthogonal cover codes available for the terminal device, andscrambling the first identification information by using the selectedorthogonal cover code; and sending, to the network device on a randomlyselected time-frequency resource used for random access, the firstmessage carrying the scrambled first identification information.
 18. Arandom access method, comprising: receiving a first message sent by aterminal device, wherein the first message comprises firstidentification information scrambled by using an orthogonal cover code,and the first message is used by the terminal device corresponding tothe first identification information to request random access to anetwork device, and where a random access radio network temporaryidentifier of the terminal device is determined by using the orthogonalcover code; and sending a second message to the terminal device based onthe first message, wherein the second message comprises identificationinformation of one or more terminal devices that succeed in randomaccess, and the identification information of the one or more terminaldevices comprises the first identification information.
 19. A randomaccess device, comprising: a memory having a storage medium, wherein thestorage medium stores a data transmission program; and a processorconnected to the memory, the processor configured to invoke the datatransmission method program stored in the memory, and further configuredto execute the following: sending a first message to a network device,wherein the first message comprises first identification informationscrambled by using an orthogonal cover code, where the first message isused by a terminal device corresponding to the first identificationinformation to request random access to the network device, and where arandom access radio network temporary identifier of the terminal deviceis determined by using the orthogonal cover code; and receiving a secondmessage sent by the network device, wherein the second message comprisesidentification information of one or more terminal devices that succeedin random access, and determining, based on whether the identificationinformation of the one or more terminal devices comprises the firstidentification information, whether the random access succeeds.